Exemplo n.º 1
0
def test_query_with_limit(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?limit=""', body='[]')
    response = api._query('nodes', limit="")
    assert response == []
Exemplo n.º 2
0
def test_query_endpoint(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes', body='[]')
    response = api._query('nodes')
    assert response == []
Exemplo n.º 3
0
def test_query_with_order_by(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?order-by=""', body='[]')
    response = api._query('nodes', order_by="")
    assert response == []
Exemplo n.º 4
0
def test_query_empty_body(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes', body='null')
    with pytest.raises(EmptyResponseError):
        api._query('nodes')
Exemplo n.º 5
0
def test_query_connection():
    api = BaseAPI(2)
    with pytest.raises(requests.exceptions.ConnectionError):
        api._query('nodes')
Exemplo n.º 6
0
def test_query_with_include_total(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?include-total=""', body='[]')
    response = api._query('nodes', include_total="")
    assert response == []
Exemplo n.º 7
0
def test_query_with_count_filter(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?count-filter=""', body='[]')
    response = api._query('nodes', count_filter="")
    assert response == []
Exemplo n.º 8
0
def test_query_with_order_by(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?order-by=""', body='[]')
    response = api._query('nodes', order_by="")
    assert response == []
Exemplo n.º 9
0
def test_query_with_limit(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?limit=""', body='[]')
    response = api._query('nodes', limit="")
    assert response == []
Exemplo n.º 10
0
def test_query_endpoint(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes', body='[]')
    response = api._query('nodes')
    assert response == []
Exemplo n.º 11
0
def test_query_connection():
    api = BaseAPI(2)
    with pytest.raises(requests.exceptions.ConnectionError):
        api._query('nodes')
Exemplo n.º 12
0
def test_query_empty_body(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes', body='null')
    with pytest.raises(EmptyResponseError):
        api._query('nodes')
Exemplo n.º 13
0
def test_query_with_count_filter(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?count-filter=""', body='[]')
    response = api._query('nodes', count_filter="")
    assert response == []
Exemplo n.º 14
0
def test_query_with_include_total(stub_get):
    api = BaseAPI(2)
    stub_get('http://localhost:8080/v2/nodes?include-total=""', body='[]')
    response = api._query('nodes', include_total="")
    assert response == []