def test_check_value_none_found(self) -> None: f = PropertiesFile() with self.assertRaises(PropertiesFile.UnexpectedKeyValueError) as err: f.check_value("invalid", "value") self.assertEqual( str(err.exception), "Expected to have invalid='value', but none was found.")
def test_check_value_invalid(self) -> None: f = PropertiesFile({"key": "value"}) with self.assertRaises(PropertiesFile.UnexpectedKeyValueError) as err: f.check_value("key", "invalid") self.assertEqual(str(err.exception), "Expected to have key='invalid', but was 'value'.")
def test_check_value(self) -> None: f = PropertiesFile({"key": "value"}) f.check_value("key", "value")