Skip to content

Commit

Permalink
fix(tests): correct logic in RadioFacets
Browse files Browse the repository at this point in the history
Ensure the test correctly validates upper and lower bounds in facet
limits.
  • Loading branch information
andreztz committed Aug 13, 2024
1 parent 5053ab1 commit 3a8da81
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 3a8da81

Please sign in to comment.