Skip to content

Commit 038e1ef

Browse files
committed
!squash more
1 parent 0530c96 commit 038e1ef

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

tests/projects/test_git.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import os
44
import pathlib
55
import textwrap
6-
from typing import Callable, Optional
6+
from typing import Callable
77

88
import pytest
99

@@ -17,7 +17,6 @@
1717
GitProject,
1818
GitRemote,
1919
GitStatus,
20-
ListQuery,
2120
convert_pip_url as git_convert_pip_url,
2221
)
2322
from libvcs.shortcuts import create_project_from_pip_url
@@ -748,18 +747,3 @@ def test_repo_git_remote_checkout(
748747

749748
assert git_repo_checkout_dir.exists()
750749
assert pathlib.Path(git_repo_checkout_dir / ".git").exists()
751-
752-
753-
@pytest.mark.parametrize(
754-
"items,filter_expr,expected_result",
755-
[
756-
[[dict(apple="fruit")], None, ListQuery([dict(apple="fruit")])],
757-
[[1, 2, 3, 4, 5], None, ListQuery([1, 2, 3, 4, 5])],
758-
],
759-
)
760-
def test_ListQuery(items: list, filter_expr: Optional[dict], expected_result: list):
761-
qs = ListQuery(data=items)
762-
if filter_expr is not None:
763-
assert qs.filter(**filter_expr) == expected_result
764-
else:
765-
assert qs.filter() == expected_result

tests/test_query.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from typing import Optional
2+
3+
import pytest
4+
5+
from libvcs.query import ListQuery
6+
7+
8+
@pytest.mark.parametrize(
9+
"items,filter_expr,expected_result",
10+
[
11+
[[dict(apple="fruit")], None, ListQuery([dict(apple="fruit")])],
12+
[[1, 2, 3, 4, 5], None, ListQuery([1, 2, 3, 4, 5])],
13+
],
14+
)
15+
def test_ListQuery(items: list, filter_expr: Optional[dict], expected_result: list):
16+
qs = ListQuery(data=items)
17+
if filter_expr is not None:
18+
assert qs.filter(**filter_expr) == expected_result
19+
else:
20+
assert qs.filter() == expected_result

0 commit comments

Comments
 (0)