Skip to content

Commit 55d3027

Browse files
author
Zhe Yu
committed
tests(cli): Improve test coverage for SpecResolver
1 parent ac085fa commit 55d3027

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/vectorcode/cli_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class Config:
113113
files_action: Optional[FilesAction] = None
114114
rm_paths: list[str] = field(default_factory=list)
115115

116-
def __hash__(self) -> int:
116+
def __hash__(self) -> int: # pragma: nocover
117117
return hash(self.__repr__())
118118

119119
@classmethod

tests/test_cli_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,12 @@ def test_specresolver():
569569
SpecResolver(spec, base_dir="nested").match([nested_path], negated=True)
570570
)
571571

572+
assert SpecResolver(spec, base_dir="nested").match_file(nested_path)
573+
assert not SpecResolver(spec, base_dir="nested").match_file(
574+
nested_path, negated=True
575+
)
576+
assert SpecResolver(spec).match_file("../outside_file.txt")
577+
572578
with tempfile.TemporaryDirectory() as dir:
573579
nested_dir = os.path.join(dir, "nested")
574580
nested_path = os.path.join(nested_dir, "file1.txt")

0 commit comments

Comments
 (0)