示例#1
0
 def test_check_value_none_found(self):
     f = ConfigFile()
     with self.assertRaises(ConfigFile.UnexpectedKeyValueError) as err:
         f.check_value("invalid", "value")
     self.assertEqual(str(err.exception), "Expected to have invalid='value', but none was found.")
示例#2
0
 def test_check_value_from_json(self):
     f = ConfigFile('{"key":"value"}')
     f.check_value("key", "value")
示例#3
0
 def test_check_value_invalid(self):
     f = ConfigFile({"key": "value"})
     with self.assertRaises(ConfigFile.UnexpectedKeyValueError) as err:
         f.check_value("key", "invalid")
     self.assertEqual(str(err.exception), "Expected to have key='invalid', but was 'value'.")
示例#4
0
 def test_check_value(self):
     f = ConfigFile({"key": "value"})
     f.check_value("key", "value")