File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 88from daq_config_server .constants import ENDPOINTS
99
1010
11- # More useful tests for the client are in tests/system_tests
1211@patch ("daq_config_server.client.requests.get" )
13- def test_get_file_contents (mock_request : MagicMock ):
14- mock_request .return_value = Response (status_code = status .HTTP_200_OK , json = "test" )
12+ def test_get_file_contents_default_header (mock_request : MagicMock ):
13+ content_type = ValidAcceptHeaders .PLAIN_TEXT
14+ mock_request .return_value = Response (
15+ status_code = status .HTTP_200_OK ,
16+ content = "test" ,
17+ headers = {
18+ "content-type" : content_type ,
19+ },
20+ )
1521 file_path = "test"
1622 url = "url"
1723 server = ConfigServer (url )
18- server .get_file_contents (file_path )
24+ assert server .get_file_contents (file_path ) == "test"
1925 mock_request .assert_called_once_with (
2026 url + ENDPOINTS .CONFIG + "/" + file_path ,
2127 headers = {"Accept" : RequestedResponseFormats .DECODED_STRING },
@@ -61,7 +67,6 @@ def test_logger_warning_if_content_type_doesnt_match_requested_type(
6167 text = "text"
6268 mock_request .return_value = Response (
6369 status_code = status .HTTP_200_OK ,
64- json = "test" ,
6570 headers = {
6671 "content-type" : content_type ,
6772 },
You can’t perform that action at this time.
0 commit comments