-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathtest_list.py
More file actions
48 lines (33 loc) · 1.51 KB
/
test_list.py
File metadata and controls
48 lines (33 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import typing as t
import pytest
from pathlib import Path
from click.testing import Result
pytestmark = pytest.mark.slow
def test_list(jaffle_shop_duckdb: Path, invoke_cli: t.Callable[..., Result]):
result = invoke_cli(["list"])
assert result.exit_code == 0
assert not result.exception
assert "main.orders" in result.output
assert "main.customers" in result.output
assert "main.stg_payments" in result.output
assert "main.raw_orders" in result.output
def test_list_select(jaffle_shop_duckdb: Path, invoke_cli: t.Callable[..., Result]):
result = invoke_cli(["list", "--select", "main.raw_customers+"])
assert result.exit_code == 0
assert not result.exception
assert "main.orders" in result.output
assert "main.customers" in result.output
assert "main.stg_customers" in result.output
assert "main.raw_customers" in result.output
assert "main.stg_payments" not in result.output
assert "main.raw_orders" not in result.output
def test_list_select_exclude(jaffle_shop_duckdb: Path, invoke_cli: t.Callable[..., Result]):
result = invoke_cli(["list", "--select", "main.raw_customers+", "--exclude", "main.orders"])
assert result.exit_code == 0
assert not result.exception
assert "main.customers" in result.output
assert "main.stg_customers" in result.output
assert "main.raw_customers" in result.output
assert "main.orders" not in result.output
assert "main.stg_payments" not in result.output
assert "main.raw_orders" not in result.output