Fix remaining linting issues - combine nested with statements
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
"""Tests for beads_mcp.config module."""
|
"""Tests for beads_mcp.config module."""
|
||||||
|
|
||||||
import os
|
|
||||||
import shutil
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
@@ -19,9 +17,7 @@ class TestConfig:
|
|||||||
monkeypatch.delenv("BEADS_PATH", raising=False)
|
monkeypatch.delenv("BEADS_PATH", raising=False)
|
||||||
|
|
||||||
# Mock shutil.which to return a test path
|
# Mock shutil.which to return a test path
|
||||||
with patch("shutil.which", return_value="/usr/local/bin/bd"):
|
with patch("shutil.which", return_value="/usr/local/bin/bd"), patch("os.access", return_value=True):
|
||||||
# Mock os.access to say the file is executable
|
|
||||||
with patch("os.access", return_value=True):
|
|
||||||
config = Config()
|
config = Config()
|
||||||
assert config.beads_path == "/usr/local/bin/bd"
|
assert config.beads_path == "/usr/local/bin/bd"
|
||||||
|
|
||||||
@@ -41,9 +37,7 @@ class TestConfig:
|
|||||||
monkeypatch.setenv("BEADS_PATH", "bd")
|
monkeypatch.setenv("BEADS_PATH", "bd")
|
||||||
|
|
||||||
# Mock shutil.which to simulate finding bd in PATH
|
# Mock shutil.which to simulate finding bd in PATH
|
||||||
with patch("shutil.which", return_value="/usr/local/bin/bd"):
|
with patch("shutil.which", return_value="/usr/local/bin/bd"), patch("os.access", return_value=True):
|
||||||
# Mock os.access to say the file is executable
|
|
||||||
with patch("os.access", return_value=True):
|
|
||||||
config = Config()
|
config = Config()
|
||||||
assert config.beads_path == "/usr/local/bin/bd"
|
assert config.beads_path == "/usr/local/bin/bd"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user