Skip to content

Commit

Permalink
expand docs and explanations
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsteers authored Mar 23, 2024
1 parent 22750a2 commit 6eaa6c4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/integration_tests/test_all_cache_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,18 @@ def test_replace_strategy(
new_generic_cache: ab.caches.CacheBase,
mocker: pytest.MockerFixture,
) -> None:
"""Test that the append strategy works as expected."""
"""Test that the replace strategy works as expected.
We expect old data to be fully replaced with newer data. For this test,
we run the 'seed b' test (expected 300 records) before the 'seed a' test
(expected 200 records). We assert the correct count of records at each step,
first 300 and then 200 records.
"""
mocker.spy(new_generic_cache.processor, '_swap_temp_table_with_final_table')
mocker.spy(new_generic_cache.processor, '_merge_temp_table_to_final_table')

assert FAKER_SCALE_B > FAKER_SCALE_A
assert FAKER_SCALE_B > FAKER_SCALE_A, \
"The test requires that 'b' has a greater count of records than 'a'."

result = source_faker_seed_b.read(
new_generic_cache,
Expand Down

0 comments on commit 6eaa6c4

Please sign in to comment.