def test_excluded(): # arrange bounty_filter = BountyFilter( None, [Filter('mimetype', FilterComparison.EQ, 'text/plain')]) # act allowed = bounty_filter.is_allowed({'mimetype': 'text/plain'}) # assert assert not allowed
def test_not_accepted(): # arrange bounty_filter = BountyFilter( [Filter('mimetype', FilterComparison.EQ, 'text/plain')], None) # act allowed = bounty_filter.is_allowed({'mimetype': 'text/html'}) # assert assert not allowed
def test_scans_artifact_accepted_match_only_one(): # arrange bounty_filter = BountyFilter([ Filter('mimetype', FilterComparison.EQ, 'text/plain'), Filter('mimetype', FilterComparison.EQ, 'text/html') ], None) # act allowed = bounty_filter.is_allowed({'mimetype': 'text/html'}) # assert assert allowed