Skip to content

Commit d06cc02

Browse files
committed
adds pokemon table count consts (#3232)
1 parent b2449e3 commit d06cc02

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

tests/load/sources/rest_api/test_rest_api_source.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
destinations_configs,
1111
DestinationTestConfiguration,
1212
)
13+
from tests.sources.rest_api.utils import POKEMON_EXPECTED_TABLE_COUNTS
1314

1415

1516
def _make_pipeline(destination_name: str):
@@ -54,10 +55,7 @@ def test_rest_api_source(destination_config: DestinationTestConfiguration) -> No
5455
table_counts = load_table_counts(pipeline)
5556

5657
assert table_counts.keys() == {"pokemon_list", "berry", "location"}
57-
58-
assert table_counts["pokemon_list"] == 1302
59-
assert table_counts["berry"] == 64
60-
assert table_counts["location"] == 1070
58+
assert table_counts.items() >= POKEMON_EXPECTED_TABLE_COUNTS.items()
6159

6260

6361
@pytest.mark.parametrize(

tests/sources/rest_api/test_rest_api_source.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from dlt.sources.rest_api import rest_api_source, rest_api
99

1010
from tests.common.configuration.utils import environment, toml_providers
11+
from tests.sources.rest_api.utils import POKEMON_EXPECTED_TABLE_COUNTS
1112
from tests.utils import ALL_DESTINATIONS
1213
from tests.pipeline.utils import assert_load_info, load_table_counts, load_tables_to_dicts
1314

@@ -78,10 +79,7 @@ def test_rest_api_source(destination_name: str, invocation_type: str) -> None:
7879
table_counts = load_table_counts(pipeline)
7980

8081
assert table_counts.keys() == {"pokemon_list", "berry", "location"}
81-
82-
assert table_counts["pokemon_list"] == 1302
83-
assert table_counts["berry"] == 64
84-
assert table_counts["location"] == 1070
82+
assert table_counts.items() >= POKEMON_EXPECTED_TABLE_COUNTS.items()
8583

8684

8785
@pytest.mark.parametrize("destination_name", ALL_DESTINATIONS)

tests/sources/rest_api/utils.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
POKEMON_EXPECTED_TABLE_COUNTS = {
2+
"pokemon_list": 1328,
3+
"berry": 64,
4+
"location": 1070,
5+
}

0 commit comments

Comments
 (0)