# WARNING: This file was not generated, but manually written.
# DON'T OVERWRITE IT
# Use it to test:
# 	npx hurl --test --variable host="http://localhost:31976" tests.hurl
# or (from root of the repo)
#   npm run test:local data-termsuite

############################################################################
# Test v1/en

POST {{host}}/v1/en?nb=10
content-type: application/x-gzip
X-Webhook-Success: https://webhook.site/2caab8b5-fc96-4d7a-bb94-bdda20977830
X-Webhook-Failure: https://webhook.site/2caab8b5-fc96-4d7a-bb94-bdda20977830
file,./examples/22-txt-en.tar.gz;

HTTP 200
# Capture the computing token
[Captures]
computing_token: jsonpath "$[0].value"
[Asserts]
variable "computing_token" exists

# There should be a waiting time, representing the time taken to process data.
# Fortunately, as the data is sparse, and the computing time is small,
# the need is small.
# In normal use cases, a webhook is called when the processing is finished.
# That query gives the process identifier.
# Next, you can call the retrieve URL by putting the identifier in the value field.

# Version 4.1.0 of hurl added a delay option, which value is milliseconds.
# https://hurl.dev/blog/2023/09/24/announcing-hurl-4.1.0.html#add-delay-between-requests

POST {{host}}/v1/retrieve-json?indent=true
content-type: application/json
[Options]
delay: 10000
```
[
	{
		"value":"{{computing_token}}"
	}
]
```

HTTP 200
Content-Type: application/json
[{
    "key": "n: sediment",
    "freq": 10
},
{
    "key": "nn: proto-paratethys sea",
    "freq": 9
},
{
    "key": "a: glacial",
    "freq": 7
},
{
    "key": "n: mmes",
    "freq": 7
},
{
    "key": "a: tropical",
    "freq": 7
},
{
    "key": "n: precipitation",
    "freq": 7
},
{
    "key": "n: genus",
    "freq": 7
},
{
    "key": "n: obliquiloculata",
    "freq": 7
},
{
    "key": "n: telescopus",
    "freq": 6
},
{
    "key": "nn: clay mineral",
    "freq": 6
}]

############################################################################
# Test v1/fr
POST {{host}}/v1/fr?nb=5
content-type: application/x-gzip
X-Webhook-Success: https://webhook.site/2caab8b5-fc96-4d7a-bb94-bdda20977830
X-Webhook-Failure: https://webhook.site/2caab8b5-fc96-4d7a-bb94-bdda20977830
file,./examples/8-txt-fr.tar.gz;

HTTP 200
# Capture the computing token
[Captures]
fr_computing_token: jsonpath "$[0].value"
[Asserts]
variable "fr_computing_token" exists

# There should be a waiting time, representing the time taken to process data.
# Fortunately, as the data is sparse, and the computing time is small,
# the need is small.
# In normal use cases, a webhook is called when the processing is finished.
# That query gives the process identifier.
# Next, you can call the retrieve URL by putting the identifier in the value field.

# Version 4.1.0 of hurl added a delay option, which value is milliseconds.
# https://hurl.dev/blog/2023/09/24/announcing-hurl-4.1.0.html#add-delay-between-requests

POST {{host}}/v1/retrieve-json?indent=true
content-type: application/json
[Options]
delay: 10000
```
[
	{
		"value":"{{fr_computing_token}}"
	}
]
```

HTTP 200
Content-Type: application/json
[{
    "key": "a: thermique",
    "freq": 12
},
{
    "key": "n: fission",
    "freq": 12
},
{
    "key": "n: biomasse",
    "freq": 10
},
{
    "key": "na: énergie éolien",
    "freq": 7
},
{
    "key": "a: électrique",
    "freq": 7
}]
