Add integration tests for nearestOffers with hubUuid parameter
All checks were successful
Build Docker Image / build (push) Successful in 1m18s
All checks were successful
Build Docker Image / build (push) Successful in 1m18s
This commit is contained in:
@@ -587,8 +587,8 @@ class TestNearestEndpoints:
|
|||||||
hub = hubs[0]
|
hub = hubs[0]
|
||||||
|
|
||||||
query = """
|
query = """
|
||||||
query NearestOffers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $hubUuid: String) {
|
query NearestOffers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $hubUuid: String, $limit: Int) {
|
||||||
nearestOffers(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, hubUuid: $hubUuid) {
|
nearestOffers(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, hubUuid: $hubUuid, limit: $limit) {
|
||||||
uuid
|
uuid
|
||||||
productUuid
|
productUuid
|
||||||
productName
|
productName
|
||||||
@@ -606,10 +606,12 @@ class TestNearestEndpoints:
|
|||||||
'lon': float(hub['longitude']) if hub['longitude'] else 0.0,
|
'lon': float(hub['longitude']) if hub['longitude'] else 0.0,
|
||||||
'radius': 10000,
|
'radius': 10000,
|
||||||
'productUuid': product['uuid'],
|
'productUuid': product['uuid'],
|
||||||
'hubUuid': hub['uuid']
|
'hubUuid': hub['uuid'],
|
||||||
|
'limit': 5 # Limit to avoid timeout when calculating routes
|
||||||
}
|
}
|
||||||
|
|
||||||
response = requests.post(GEO_URL, json={'query': query, 'variables': variables})
|
# Use longer timeout as route calculation takes time
|
||||||
|
response = requests.post(GEO_URL, json={'query': query, 'variables': variables}, timeout=120)
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
|
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user