Merge branch 'bugfix/http2_request' into 'master'

CI: Fix example test for http_request

See merge request espressif/esp-idf!15819
pull/7855/head
Ivan Grokhotkov 2021-11-04 18:49:55 +00:00
commit 263fe84130
1 zmienionych plików z 10 dodań i 7 usunięć

Wyświetl plik

@ -16,13 +16,16 @@ TEST_SERVER = 'http2.golang.org'
def is_test_server_available(): # type: () -> bool
# 443 - default https port
conn = http.client.HTTPSConnection(TEST_SERVER, 443, timeout=10)
conn.request('GET', '/')
resp = conn.getresponse()
conn.close()
if resp.status == HTTP_OK:
return True
return False
try:
conn = http.client.HTTPSConnection(TEST_SERVER, 443, timeout=10)
conn.request('GET', '/')
resp = conn.getresponse()
return True if resp.status == HTTP_OK else False
except Exception as msg:
Utility.console_log('Exception occurred when connecting to {}: {}'.format(TEST_SERVER, msg))
return False
finally:
conn.close()
@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1')