Skip to content

Commit 7cc40ea

Browse files
committed
feat(cli): Improve test coverage for vectorise
1 parent 938abf8 commit 7cc40ea

File tree

3 files changed

+162
-757
lines changed

3 files changed

+162
-757
lines changed

src/vectorcode/subcommands/vectorise/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ async def vectorise_worker(
9292
stats_lock: Lock,
9393
):
9494
async with semaphore, stats_lock:
95-
stats += await database.vectorise(
96-
file_path=file_path,
97-
)
95+
if os.path.isfile(file_path):
96+
stats += await database.vectorise(
97+
file_path=file_path,
98+
)
9899

99100

100101
async def vectorise(configs: Config) -> int:
@@ -152,7 +153,7 @@ async def vectorise(configs: Config) -> int:
152153
for task in asyncio.as_completed(tasks):
153154
await task
154155
bar.update(1)
155-
except asyncio.CancelledError:
156+
except asyncio.CancelledError: # pragma: nocover
156157
logger.warning("Abort.")
157158
return 1
158159

src/vectorcode/subcommands/vectorise/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class FilterManager:
1212
def __init__(self, from_filters: Sequence[FileFilter] | None = None) -> None:
1313
self._filters: list[FileFilter] = []
14-
if from_filters:
14+
if from_filters: # pragma: nocover
1515
self._filters.extend(from_filters)
1616

1717
def add_filter(self, f: FileFilter = lambda x: bool(x)) -> Self:

0 commit comments

Comments
 (0)