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