def test_repository_list_with_filters_elevation__gt(station_dicts): repo = memrepo.MemRepo(station_dicts) _check_results(repo.list(filters={'elevation__gt': 12344}), [station_dicts[1]])
def test_repository_list_with_filters_id(station_dicts): repo = memrepo.MemRepo(station_dicts) _check_results(repo.list(filters={'id': 125}), [station_dicts[2]])
def test_repository_list_with_filters_latitude(station_dicts): repo = memrepo.MemRepo(station_dicts) _check_results(repo.list(filters={'latitude__eq': 51.78436293}), [station_dicts[3]])
def test_repository_list_with_filters_elevation(station_dicts): repo = memrepo.MemRepo(station_dicts) lista = repo.list(filters={'elevation': 1230}) _check_results(lista, [station_dicts[3]])
def test_repository_list_with_filters_unknown_operator(station_dicts): repo = memrepo.MemRepo(station_dicts) with pytest.raises(ValueError): repo.list(filters={'price__in': [20, 30]})
def test_repository_list_with_filters_unknown_key(station_dicts): repo = memrepo.MemRepo(station_dicts) with pytest.raises(KeyError): repo.list(filters={'namee': 'aname'})
def test_repository_list_without_parameters(station_dicts): repo = memrepo.MemRepo(station_dicts) lista = repo.list() _check_results(lista, station_dicts)