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 == []
def test_query_endpoint(stub_get): api = BaseAPI(2) stub_get('http://localhost:8080/v2/nodes', body='[]') response = api._query('nodes') assert response == []
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 == []
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')
def test_query_connection(): api = BaseAPI(2) with pytest.raises(requests.exceptions.ConnectionError): api._query('nodes')
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 == []
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 == []