Skip to content

Commit 2f2ad5a

Browse files
Merge branch 'IDSSE-1001' of https://github.com/NOAA-GSL/idss-engine-commons into IDSSE-1001
2 parents d0ba6e6 + 73965fc commit 2f2ad5a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

python/idsse_common/test/test_http_utils.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# ----------------------------------------------------------------------------------
1212
# pylint: disable=missing-function-docstring,redefined-outer-name,pointless-statement
13-
# pylint: disable=invalid-name,unused-argument,duplicate-code,line-too-long
13+
# pylint: disable=invalid-name,unused-argument, duplicate-code, line-too-long
1414

1515
from datetime import datetime, timedelta, UTC
1616

@@ -65,45 +65,45 @@ def test_get_path(http_utils: HttpUtils):
6565
assert result_path == f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}MRMS_MergedReflectivityQC_00.50_20241030-205438.grib2.gz'
6666

6767

68-
def test_ls(http_utils: HttpUtils, httpserver: HTTPServer):
68+
def test_http_ls(http_utils: HttpUtils, httpserver: HTTPServer):
6969
httpserver.expect_request('/data/'+EXAMPLE_ENDPOINT).respond_with_data(EXAMPLE_RETURN,
7070
content_type="text/plain")
71-
result = http_utils.ls(EXAMPLE_URL + EXAMPLE_ENDPOINT)
71+
result = http_utils.http_ls(EXAMPLE_URL + EXAMPLE_ENDPOINT)
7272
assert len(result) == len(EXAMPLE_FILES)
7373
assert result[0] == f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}{EXAMPLE_FILES[0]}'
7474

7575

76-
def test_ls_without_prepend_path(http_utils: HttpUtils, httpserver: HTTPServer):
76+
def test_http_ls_without_prepend_path(http_utils: HttpUtils, httpserver: HTTPServer):
7777
httpserver.expect_request('/data/'+EXAMPLE_ENDPOINT).respond_with_data(EXAMPLE_RETURN,
7878
content_type="text/plain")
79-
result = http_utils.ls(EXAMPLE_URL + EXAMPLE_ENDPOINT, prepend_path=False)
79+
result = http_utils.http_ls(EXAMPLE_URL + EXAMPLE_ENDPOINT, prepend_path=False)
8080
assert len(result) == len(EXAMPLE_FILES)
8181
assert result[0] == EXAMPLE_FILES[0]
8282

8383

84-
def test_ls_on_error(http_utils: HttpUtils, httpserver: HTTPServer):
84+
def test_http_ls_on_error(http_utils: HttpUtils, httpserver: HTTPServer):
8585
httpserver.expect_request('/data/'+EXAMPLE_ENDPOINT).respond_with_data('', content_type="text/plain")
86-
result = http_utils.ls(EXAMPLE_URL + EXAMPLE_ENDPOINT)
86+
result = http_utils.http_ls(EXAMPLE_URL + EXAMPLE_ENDPOINT)
8787
assert result == []
8888

8989

90-
def test_cp_succeeds(http_utils: HttpUtils, httpserver: HTTPServer):
90+
def test_http_cp_succeeds(http_utils: HttpUtils, httpserver: HTTPServer):
9191
url = '/data/'+EXAMPLE_PROD_DIR+'/temp.grib2.gz'
9292
httpserver.expect_request(url).respond_with_data(bytes([0,1,2]), status=200,
9393
content_type="application/octet-stream")
9494
path = f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}/temp.grib2.gz'
9595
dest = '/tmp/temp.grib2.gz'
9696

97-
copy_success = http_utils.cp(path, dest)
97+
copy_success = http_utils.http_cp(path, dest)
9898
assert copy_success
9999

100-
def test_cp_fails(http_utils: HttpUtils, httpserver: HTTPServer):
100+
def test_http_cp_fails(http_utils: HttpUtils, httpserver: HTTPServer):
101101
url = '/data/'+EXAMPLE_PROD_DIR+'/temp.grib2.gz'
102102
httpserver.expect_request(url).respond_with_data(bytes([0, 1, 2]), status=404,
103103
content_type="application/octet-stream")
104104
path = f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}/temp.grib2.gz'
105105
dest = '/tmp/temp.grib2.gz'
106-
copy_success = http_utils.cp(path, dest)
106+
copy_success = http_utils.http_cp(path, dest)
107107
assert not copy_success
108108

109109

0 commit comments

Comments
 (0)