Commit 4d534632 authored by Niklas Keck's avatar Niklas Keck
Browse files

Added test for timeout Exception

- Timeout will occur if either timeout argument is too small or gts2
is too slow to answer.
- If no timeout argument is set, the client will wait indefinitly as
before. Thus commit 16b80c1f should
not have any effect on existing code. Existing tests should cover that
assumption sufficiently.
parent 16b80c1f
Pipeline #10165 failed with stages
in 43 minutes and 37 seconds
......@@ -9,6 +9,7 @@ import os
from os import path
import subprocess
import sys
from requests.exceptions import ReadTimeout
geo_ll = (12.559433, 53.036066)
geo_ur = (12.737961, 53.238058)
......@@ -362,6 +363,26 @@ class TestGts2Client(unittest.TestCase):
except ChildProcessError:
print("Test OK.")
try:
print("#### Testing timeout from client.")
gts2_client.client(
out_mode="single",
geo_ll=geo_ll,
geo_ur=geo_ur,
bands="B08",
start_date=start_date,
end_date=end_date,
version=version,
level=level,
max_cloudy=max_cloudy,
minimum_fill=minimum_fill,
stack_resolution=stack_res,
quiet=False,
sensor="S2A",
timeout=1)
except ReadTimeout:
print("Test OK.")
def test_gts2_client_command_line(self):
"""
Tests the command line call and the argument parsing.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment