Skip to content

Commit 144faa6

Browse files
committed
Fixes
1 parent 378e8cd commit 144faa6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

docs/how-to/config-server-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ By default, this will return the file's raw string output - which includes thing
2020
(file-converters)=
2121
# File converters
2222

23-
Converters can be used to turn a file into a standard format server-side, reducing the complexity of reading config files client-side. Converters can convert config files to a `dict` or pydantic model, and the same pydantic model can be reconstructed client-side by the `get_file_contents` method. Available converters and models exist [here](https://github.com/DiamondLightSource/daq-config-server/blob/main/src/daq_config_server/converters/), divided into modules based on the type of config they convert - see if there's a suitable converter you can use before adding your own. [This dictionary](https://github.com/DiamondLightSource/daq-config-server/blob/main/src/daq_config_server/converters/_file_converter_map.py) maps files to converters. Add the path of your config file and a suitable converter to this dictionary and it will automatically be used by the config server when a request for that file is made. Models should be added to this [`__init__.py`](https://github.com/DiamondLightSource/daq-config-server/blob/main/src/daq_config_server/models/__init__.py) so that they can be imported with `from daq_config_server.models import MyModel`.
23+
Converters can be used to turn a file into a standard format server-side, reducing the complexity of reading config files client-side. Converters can convert config files to a `dict` or pydantic model, and the same pydantic model can be reconstructed client-side by the `get_file_contents` method. Available converters and models exist [here](https://github.com/DiamondLightSource/daq-config-server/blob/main/src/daq_config_server/models/converters/), divided into modules based on the type of config they convert - see if there's a suitable converter you can use before adding your own. [This dictionary](https://github.com/DiamondLightSource/daq-config-server/blob/main/src/daq_config_server/models/converters/_file_converter_map.py) maps files to converters. Add the path of your config file and a suitable converter to this dictionary and it will automatically be used by the config server when a request for that file is made. Models should be added to this [`__init__.py`](https://github.com/DiamondLightSource/daq-config-server/blob/main/src/daq_config_server/models/__init__.py) so that they can be imported with `from daq_config_server.models import MyModel`.
2424

2525
A request for `str` or `bytes` will fetch the raw file with no conversion.
2626

tests/system_tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def test_all_files_in_file_converter_map_can_be_converted_to_target_type(
166166
deployed_server: ConfigServer,
167167
):
168168
with patch(
169-
"daq_config_server.converters._file_converter_map.xmltodict.parse.__annotations__",
169+
"daq_config_server.models.converters._file_converter_map.xmltodict.parse.__annotations__",
170170
{"return": dict}, # Force a return type for xmltodict.parse()
171171
):
172172
for filename, converter in FILE_TO_CONVERTER_MAP.items():

0 commit comments

Comments
 (0)