forked from openfoodfacts/openfoodfacts-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added geoip route in routing.t (openfoodfacts#10661)
- Loading branch information
Showing
12 changed files
with
315 additions
and
228 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
tests/unit/expected_test_results/routing/api-v0-attribute-groups.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
tests/unit/expected_test_results/routing/api-v3-product-code.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/unit/expected_test_results/routing/api-v3-product-gs1-data-uri.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
] | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/unit/expected_test_results/routing/facet-url-group-by-in-english.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
26
tests/unit/expected_test_results/routing/facet-url-group-by.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
25 changes: 25 additions & 0 deletions
25
tests/unit/expected_test_results/routing/facet-url-with-page-number.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} |
28 changes: 28 additions & 0 deletions
28
tests/unit/expected_test_results/routing/facet-url-with-synonym-and-page-number.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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": [] | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/unit/expected_test_results/routing/geoip-get-country-from-ipv4-us.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
22 changes: 22 additions & 0 deletions
22
tests/unit/expected_test_results/routing/geoip-get-country-from-ipv6-fr.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
32 changes: 32 additions & 0 deletions
32
tests/unit/expected_test_results/routing/invalid-last-url-component.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.