|
10 | 10 | #
|
11 | 11 | # ----------------------------------------------------------------------------------
|
12 | 12 | # 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 |
14 | 14 |
|
15 | 15 | from datetime import datetime, timedelta, UTC
|
16 | 16 |
|
@@ -65,45 +65,45 @@ def test_get_path(http_utils: HttpUtils):
|
65 | 65 | assert result_path == f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}MRMS_MergedReflectivityQC_00.50_20241030-205438.grib2.gz'
|
66 | 66 |
|
67 | 67 |
|
68 |
| -def test_ls(http_utils: HttpUtils, httpserver: HTTPServer): |
| 68 | +def test_http_ls(http_utils: HttpUtils, httpserver: HTTPServer): |
69 | 69 | httpserver.expect_request('/data/'+EXAMPLE_ENDPOINT).respond_with_data(EXAMPLE_RETURN,
|
70 | 70 | content_type="text/plain")
|
71 |
| - result = http_utils.ls(EXAMPLE_URL + EXAMPLE_ENDPOINT) |
| 71 | + result = http_utils.http_ls(EXAMPLE_URL + EXAMPLE_ENDPOINT) |
72 | 72 | assert len(result) == len(EXAMPLE_FILES)
|
73 | 73 | assert result[0] == f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}{EXAMPLE_FILES[0]}'
|
74 | 74 |
|
75 | 75 |
|
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): |
77 | 77 | httpserver.expect_request('/data/'+EXAMPLE_ENDPOINT).respond_with_data(EXAMPLE_RETURN,
|
78 | 78 | 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) |
80 | 80 | assert len(result) == len(EXAMPLE_FILES)
|
81 | 81 | assert result[0] == EXAMPLE_FILES[0]
|
82 | 82 |
|
83 | 83 |
|
84 |
| -def test_ls_on_error(http_utils: HttpUtils, httpserver: HTTPServer): |
| 84 | +def test_http_ls_on_error(http_utils: HttpUtils, httpserver: HTTPServer): |
85 | 85 | 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) |
87 | 87 | assert result == []
|
88 | 88 |
|
89 | 89 |
|
90 |
| -def test_cp_succeeds(http_utils: HttpUtils, httpserver: HTTPServer): |
| 90 | +def test_http_cp_succeeds(http_utils: HttpUtils, httpserver: HTTPServer): |
91 | 91 | url = '/data/'+EXAMPLE_PROD_DIR+'/temp.grib2.gz'
|
92 | 92 | httpserver.expect_request(url).respond_with_data(bytes([0,1,2]), status=200,
|
93 | 93 | content_type="application/octet-stream")
|
94 | 94 | path = f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}/temp.grib2.gz'
|
95 | 95 | dest = '/tmp/temp.grib2.gz'
|
96 | 96 |
|
97 |
| - copy_success = http_utils.cp(path, dest) |
| 97 | + copy_success = http_utils.http_cp(path, dest) |
98 | 98 | assert copy_success
|
99 | 99 |
|
100 |
| -def test_cp_fails(http_utils: HttpUtils, httpserver: HTTPServer): |
| 100 | +def test_http_cp_fails(http_utils: HttpUtils, httpserver: HTTPServer): |
101 | 101 | url = '/data/'+EXAMPLE_PROD_DIR+'/temp.grib2.gz'
|
102 | 102 | httpserver.expect_request(url).respond_with_data(bytes([0, 1, 2]), status=404,
|
103 | 103 | content_type="application/octet-stream")
|
104 | 104 | path = f'{EXAMPLE_URL}{EXAMPLE_PROD_DIR}/temp.grib2.gz'
|
105 | 105 | dest = '/tmp/temp.grib2.gz'
|
106 |
| - copy_success = http_utils.cp(path, dest) |
| 106 | + copy_success = http_utils.http_cp(path, dest) |
107 | 107 | assert not copy_success
|
108 | 108 |
|
109 | 109 |
|
|
0 commit comments