Exemple #1
0
 def test_attributes_return_for_key_value_if_key_present(
     self, key, expected, minimal_definition_dict
 ):
     minimal_definition_dict["settings"] = {"services": {"udc": {key: expected}}}
     config = UDCSettingsConfig(minimal_definition_dict, dummy_env)
     MISSING = object()
     assert getattr(config, key, MISSING) == expected
Exemple #2
0
 def test_token_attribute_is_an_instance_of_udctokenconfig(self, minimal_definition_dict):
     assert isinstance(
         UDCSettingsConfig(minimal_definition_dict, dummy_env).token, UDCTokenSettings
     )
Exemple #3
0
 def test_attributes_whose_key_is_absent_return_expected_default(
     self, key, expected, minimal_definition_dict
 ):
     config = UDCSettingsConfig(minimal_definition_dict, dummy_env)
     MISSING = object()
     assert getattr(config, key, MISSING) == expected
Exemple #4
0
 def test_is_subclass_of_config_mapping(self, minimal_yaml_dict):
     """The class is a subclass of :class:`ConfigMapping`."""
     assert isinstance(UDCSettingsConfig(minimal_yaml_dict), ConfigMapping)