def test_parse_environment_as_dict(self): environment = { 'NORMAL': 'F1', 'CONTAINS_EQUALS': 'F=2', 'TRAILING_EQUALS': None, } self.assertEqual(config.parse_environment(environment), environment)
def test_parse_environment_as_list(self): environment = [ 'NORMAL=F1', 'CONTAINS_EQUALS=F=2', 'TRAILING_EQUALS=', ] self.assertEqual( config.parse_environment(environment), {'NORMAL': 'F1', 'CONTAINS_EQUALS': 'F=2', 'TRAILING_EQUALS': ''}, )
def test_parse_environment_empty(self): self.assertEqual(config.parse_environment(None), {})
def test_parse_environment_invalid(self): with self.assertRaises(ConfigurationError): config.parse_environment('a=b')
def test_parse_environment_as_dict(self): environment = {"NORMAL": "F1", "CONTAINS_EQUALS": "F=2", "TRAILING_EQUALS": None} self.assertEqual(config.parse_environment(environment), environment)
def test_parse_environment_as_list(self): environment = ["NORMAL=F1", "CONTAINS_EQUALS=F=2", "TRAILING_EQUALS="] self.assertEqual( config.parse_environment(environment), {"NORMAL": "F1", "CONTAINS_EQUALS": "F=2", "TRAILING_EQUALS": ""} )