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