Skip to content

Commit

Permalink
test: added geoip route in routing.t (openfoodfacts#10661)
Browse files Browse the repository at this point in the history
  • Loading branch information
4nt0ineB authored Aug 8, 2024
1 parent 2e5cb4c commit 1fbb77a
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 228 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"api" : "v0",
"api_action" : "attribute_groups",
"api_method" : null,
"api_version" : "0",
"cc" : "world",
"lc" : "en",
"original_query_string" : "api/v0/attribute_groups",
"page" : 1,
"query_string" : "api/v0/attribute_groups",
"no_index" : "0",
"is_crawl_bot" : "1",
"rate_limiter_blocking" : 0,
"rate_limiter_limit" : null,
"rate_limiter_user_requests" : null,
"components" : ["api", "v0", "attribute_groups"]
}
23 changes: 23 additions & 0 deletions tests/unit/expected_test_results/routing/api-v3-product-code.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"api": "v3",
"api_action": "product",
"api_method": null,
"api_version": "3",
"cc": "world",
"lc": "en",
"original_query_string": "api/v3/product/03564703999971",
"query_string": "api/v3/product/03564703999971",
"code": "03564703999971",
"page": "1",
"no_index": "0",
"is_crawl_bot": "0",
"rate_limiter_blocking": 0,
"rate_limiter_limit": 100,
"rate_limiter_user_requests": null,
"components": [
"api",
"v3",
"product",
"03564703999971"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"api": "v3",
"api_action": "product",
"api_method": null,
"api_version": "3",
"cc": "world",
"lc": "en",
"original_query_string": "api/v3/product/https%3A%2F%2Fid.gs1.org%2F01%2F03564703999971%2F10%2FABC%2F21%2F123456%3F17%3D211200",
"query_string": "api/v3/product/https%3A%2F%2Fid.gs1.org%2F01%2F03564703999971%2F10%2FABC%2F21%2F123456%3F17%3D211200",
"code": "https://id.gs1.org/01/03564703999971/10/ABC/21/123456?17=211200",
"page": "1",
"no_index": "0",
"is_crawl_bot": "0",
"rate_limiter_blocking": 0,
"rate_limiter_limit": 100,
"rate_limiter_user_requests": null,
"components": [
"api",
"v3",
"product",
"https://id.gs1.org/01/03564703999971/10/ABC/21/123456?17=211200"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"components": [],
"groupby_tagtype": "ingredients",
"tags": [
{
"tag": "es:breads",
"tagid": "es:breads",
"tag_prefix": "",
"tagtype": "categories"
}
],
"is_crawl_bot": "1",
"tag_prefix": "",
"tagtype": "categories",
"canon_rel_url": "/categoria/es:breads/ingredientes",
"cc": "world",
"query_string": "category/breads/ingredients",
"original_query_string": "category/breads/ingredients",
"tagid": "es:breads",
"tag": "es:breads",
"api": "v0",
"lc": "es",
"no_index": 1,
"param": {},
"page": 1
}
26 changes: 26 additions & 0 deletions tests/unit/expected_test_results/routing/facet-url-group-by.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"tag_prefix": "",
"components": [],
"no_index": 1,
"canon_rel_url": "/category/en:breads/ingredients",
"api": "v0",
"query_string": "category/breads/ingredients",
"original_query_string": "category/breads/ingredients",
"tagid": "en:breads",
"tagtype": "categories",
"tag": "en:breads",
"lc": "en",
"cc": "world",
"page": 1,
"tags": [
{
"tag": "en:breads",
"tagtype": "categories",
"tagid": "en:breads",
"tag_prefix": ""
}
],
"is_crawl_bot": "1",
"param": {},
"groupby_tagtype": "ingredients"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"api": "v0",
"canon_rel_url": "/category/en:breads",
"cc": "world",
"lc": "en",
"original_query_string": "category/breads/4",
"page": "4",
"query_string": "category/breads/4",
"tag": "en:breads",
"tag_prefix": "",
"tagid": "en:breads",
"tagtype": "categories",
"tags": [
{
"tag": "en:breads",
"tag_prefix": "",
"tagid": "en:breads",
"tagtype": "categories"
}
],
"param": {},
"no_index": "1",
"is_crawl_bot": "1",
"components": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"api": "v0",
"canon_rel_url": "/category/en:bread",
"cc": "world",
"lc": "en",
"original_query_string": "category/bread/4",
"page": "4",
"query_string": "category/bread/4",
"tag": "en:bread",
"tag_prefix": "",
"tagid": "en:bread",
"tagtype": "categories",
"tags": [
{
"tag": "en:bread",
"tag_prefix": "",
"tagid": "en:bread",
"tagtype": "categories"
}
],
"param": {},
"no_index": "0",
"is_crawl_bot": "0",
"rate_limiter_blocking": 0,
"rate_limiter_limit": null,
"rate_limiter_user_requests": null,
"components": []
}
28 changes: 28 additions & 0 deletions tests/unit/expected_test_results/routing/facet-url.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"api": "v0",
"canon_rel_url": "/category/en:breads",
"cc": "world",
"lc": "en",
"original_query_string": "category/breads",
"page": 1,
"query_string": "category/breads",
"tag": "en:breads",
"tag_prefix": "",
"tagid": "en:breads",
"tagtype": "categories",
"tags": [
{
"tag": "en:breads",
"tag_prefix": "",
"tagid": "en:breads",
"tagtype": "categories"
}
],
"param": {},
"no_index": "0",
"is_crawl_bot": "1",
"rate_limiter_blocking": 0,
"rate_limiter_limit": null,
"rate_limiter_user_requests": null,
"components": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"original_query_string": "api/v3/geopip/12.45.23.45",
"page": 1,
"cc": "world",
"api_version": "3",
"components": [
"api",
"v3",
"geopip",
"12.45.23.45"
],
"is_crawl_bot": "0",
"no_index": "0",
"rate_limiter_blocking": 0,
"query_string": "api/v3/geopip/12.45.23.45",
"api": "v3",
"rate_limiter_limit": null,
"api_action": "geopip",
"rate_limiter_user_requests": null,
"api_method": null,
"lc": "en"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"api_action": "geopip",
"lc": "en",
"cc": "world",
"rate_limiter_user_requests": null,
"api": "v3",
"rate_limiter_blocking": 0,
"is_crawl_bot": "0",
"no_index": "0",
"api_version": "3",
"page": 1,
"api_method": null,
"components": [
"api",
"v3",
"geopip",
"2001:ac8:25:3b::e01d"
],
"original_query_string": "api/v3/geopip/2001:ac8:25:3b::e01d",
"query_string": "api/v3/geopip/2001:ac8:25:3b::e01d",
"rate_limiter_limit": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"api": "v0",
"canon_rel_url": "/category/en:breads",
"cc": "world",
"error_message": "Invalid address.",
"lc": "en",
"original_query_string": "category/breads/no-nutrition-data",
"page": 1,
"query_string": "category/breads/no-nutrition-data",
"status_code": 404,
"tag": "en:breads",
"tag_prefix": "",
"tagid": "en:breads",
"tagtype": "categories",
"tags": [
{
"tag": "en:breads",
"tag_prefix": "",
"tagid": "en:breads",
"tagtype": "categories"
}
],
"param": {},
"no_index": "0",
"is_crawl_bot": "0",
"components": [
"no-nutrition-data"
],
"rate_limiter_blocking": 0,
"rate_limiter_limit": null,
"rate_limiter_user_requests": null
}
Loading

0 comments on commit 1fbb77a

Please sign in to comment.