Beispiel #1
0
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
Beispiel #2
0
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
Beispiel #3
0
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