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