Example #1
0
def test_id_matches_exact():
    data = {'$id': '2'}
    assert id_matches(data, data['$id'])
Example #2
0
def test_id_matches_no_id():
    data = {'blarg': '2'}
    assert not id_matches(data, data['blarg'])
Example #3
0
def test_list_is_not_match_and_does_not_error():
    data = [{'$id': '2'}, {'$id': '3'}]
    assert not id_matches(data, '2')
Example #4
0
def test_non_iterable_data_type_is_not_match_and_does_not_error():
    assert not id_matches(2.14376, '2')
Example #5
0
def test_empty_is_not_match_and_does_not_error():
    assert not id_matches({}, '2')
Example #6
0
def test_none_is_not_match_and_does_not_error():
    assert not id_matches(None, '2')
Example #7
0
def test_id_does_not_match():
    data = {'$id': '2'}
    ref = str(int(data['$id']) + 1)
    assert not id_matches(data, ref)