Skip to content

Commit

Permalink
added test for batch size (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
cehbrecht committed Feb 5, 2021
1 parent 9e7c7d6 commit 0562c14
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_results.py
Expand Up @@ -237,3 +237,20 @@ def test_shards_constrain4(self):
searchContext = searchContext.constrain(variable='tas')
for j in searchContext.search():
print((j.download_url, j.checksum, j.checksum_type, j.size))

@pytest.mark.slow
def test_batch_size_has_no_impact_on_results(self):
conn = SearchConnection(self.test_service, distrib=True)
ctx = conn.new_context(
mip_era='CMIP6', institution_id='CCCma',
experiment_id='pdSST-pdSIC', table_id='Amon', variable_id='ua')
results = ctx.search(batch_size=50)
ids_batch_size_50 = sorted(results, key=lambda x: x.dataset_id)

ctx = conn.new_context(
mip_era='CMIP6', institution_id='CCCma',
experiment_id='pdSST-pdSIC', table_id='Amon', variable_id='ua')
results = ctx.search(batch_size=100)
ids_batch_size_100 = sorted(results, key=lambda x: x.dataset_id)

assert len(ids_batch_size_50) == len(ids_batch_size_100)

0 comments on commit 0562c14

Please sign in to comment.