示例#1
0
def test_good_for_bad_resource(fake_good_request, good_for_predicate,
                               bad_resource_predicate):
    kwargs = dict(for_=FakeGoodView)
    predicate_values = [good_for_predicate, bad_resource_predicate]
    result = predicates_match(fake_good_request, predicate_values, **kwargs)
    assert not result
示例#2
0
def test_nomatch_parentid(fake_good_request, bad_parentid_predicate):
    kwargs = dict(for_=FakeGoodView)
    predicate_values = [bad_parentid_predicate]
    result = predicates_match(fake_good_request, predicate_values, **kwargs)
    assert not result
示例#3
0
def test_nomatch_resource(fake_good_request, bad_resource_predicate):
    """ View service asks for one resource but registration is for another """
    kwargs = dict(for_=FakeGoodView)
    predicate_values = [bad_resource_predicate]
    result = predicates_match(fake_good_request, predicate_values, **kwargs)
    assert not result
示例#4
0
def test_match_resourceid(fake_good_request, good_resourceid_predicate):
    kwargs = dict(for_=FakeGoodView)
    predicate_values = [good_resourceid_predicate]
    result = predicates_match(fake_good_request, predicate_values, **kwargs)
    assert result
示例#5
0
def test_match_empty_predicates_list(fake_good_request, good_for_predicate):
    result = predicates_match(fake_good_request, [])
    assert result