2020)
2121
2222SERVER_ADDRESS = "http://0.0.0.0:8555"
23+ DEPLOYED_SERVER_ADDRESS = "https://daq-config.diamond.ac.uk"
2324
2425# Docs for running these system tests will be added in https://github.com/DiamondLightSource/daq-config-server/issues/68
2526
@@ -29,6 +30,11 @@ def server():
2930 return ConfigServer (SERVER_ADDRESS )
3031
3132
33+ @pytest .fixture
34+ def deployed_server ():
35+ return ConfigServer (DEPLOYED_SERVER_ADDRESS )
36+
37+
3238@pytest .mark .requires_local_server
3339def test_read_unformatted_file_as_plain_text (server : ConfigServer ):
3440 with open (TestDataPaths .TEST_BEAMLINE_PARAMETERS_PATH ) as f :
@@ -144,23 +150,29 @@ def test_request_for_file_with_converter_with_wrong_pydantic_model_errors(
144150 server .get_file_contents (ServerFilePaths .GOOD_LUT , DisplayConfig )
145151
146152
147- @pytest .mark .requires_local_server
148- def test_all_files_in_file_converter_map_can_be_converted_to_dict (server : ConfigServer ):
153+ @pytest .mark .requires_deployed_server
154+ def test_all_files_in_file_converter_map_can_be_converted_to_dict (
155+ deployed_server : ConfigServer ,
156+ ):
149157 for filename in file_converter_map .FILE_TO_CONVERTER_MAP .keys ():
150- result = server .get_file_contents (filename , dict )
158+ if filename .startswith ("/tests/test_data/" ):
159+ continue
160+ result = deployed_server .get_file_contents (filename , dict )
151161 assert isinstance (result , dict )
152162
153163
154- @pytest .mark .requires_local_server
164+ @pytest .mark .requires_deployed_server
155165def test_all_files_in_file_converter_map_can_be_converted_to_target_type (
156- server : ConfigServer ,
166+ deployed_server : ConfigServer ,
157167):
158168 with patch (
159169 "daq_config_server.converters._file_converter_map.xmltodict.parse.__annotations__" ,
160170 {"return" : dict }, # Force a return type for xmltodict.parse()
161171 ):
162172 for filename , converter in file_converter_map .FILE_TO_CONVERTER_MAP .items ():
173+ if filename .startswith ("/tests/test_data/" ):
174+ continue
163175 return_type = get_type_hints (converter )["return" ]
164176 assert return_type is dict or issubclass (return_type , ConfigModel )
165- result = server .get_file_contents (filename , return_type )
177+ result = deployed_server .get_file_contents (filename , return_type )
166178 assert isinstance (result , return_type )
0 commit comments