예제 #1
0
def test_get(config):
    """Testing query for a specific object"""
    p = PostgreSQLProvider(config)
    results = p.get(29701937)
    print(results)
    assert len(results['features']) == 1
    assert "Kanyosha" in results['features'][0]['properties']['name']
예제 #2
0
def test_get(config):
    """Testing query for a specific object"""
    p = PostgreSQLProvider(config)
    result = p.get(29701937)
    assert isinstance(result, dict)
    assert 'geometry' in result
    assert 'properties' in result
    assert 'id' in result
    assert 'Kanyosha' in result['properties']['name']
예제 #3
0
def test_get_not_existing_item_raise_exception(config):
    """Testing query for a not existing object"""
    p = PostgreSQLProvider(config)
    with pytest.raises(ProviderItemNotFoundError):
        p.get(-1)