Skip to content

Commit

Permalink
fix(tests): Ensure correct upper and lower limits in RadioFacets tests
Browse files Browse the repository at this point in the history
Fix logic errors in tests to properly enforce upper and lower limits
for facet searches in the RadioFacets class
  • Loading branch information
andreztz committed Aug 15, 2024
1 parent 5053ab1 commit c430e61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_radio_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_facet_init(rb):
anytag = random.choice(anystation['tags'].split(','))
foundtags = list(filter(lambda t: t['name'] == anytag, rf.tags))
assert len(foundtags) == 1, f"tag '{anytag}' not in the result-set"
assert foundtags[0]['count'] > 1, f"not even one match '{anytag}'"
assert foundtags[0]["count"] >= 1, f"not even one match '{anytag}'"

assert rf.countrycodes is not None, "expecting a contrycode histogram"
assert rf.languages is not None, "expecting a language histogram"
Expand Down Expand Up @@ -94,9 +94,9 @@ def test_facet_narrow_broaden(rb):

# broaden up by skipping the country and language constraint
rfklaralim = rfbenlklaralim.broaden(**qry_be, **qry_nl)
assert len(rfbenlklaralim) <= len(rfklaralim) < limit
log.debug(f"found {len(rfklaralim)} stations " +
f"matching {rfklaralim.filter}")
assert len(rfbenlklaralim) <= len(rfklaralim) <= limit

# exchange the limit constraint with a tag constraint
rfklaraclss = rfklaralim.broaden(tuple(qry_lim.keys())).narrow(**qry_clss)
Expand Down

0 comments on commit c430e61

Please sign in to comment.