Beispiel #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 == []
Beispiel #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 == []
Beispiel #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 == []
Beispiel #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')
Beispiel #5
0
def test_query_connection():
    api = BaseAPI(2)
    with pytest.raises(requests.exceptions.ConnectionError):
        api._query('nodes')
Beispiel #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 == []
Beispiel #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 == []
Beispiel #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 == []
Beispiel #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 == []
Beispiel #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 == []
Beispiel #11
0
def test_query_connection():
    api = BaseAPI(2)
    with pytest.raises(requests.exceptions.ConnectionError):
        api._query('nodes')
Beispiel #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')
Beispiel #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 == []
Beispiel #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 == []