Ejemplo n.º 1
0
    def test_read_base_string(self):
        config = self.load_config()

        val = config.get_value("stringValue", dtype=str, required=True)

        self.assertEqual(val, "this is a string",
                         "stringValue not read from base config")
Ejemplo n.º 2
0
    def test_read_number(self):
        config = self.load_config()

        val = config.get_value("numberValue", dtype=int, required=True)

        self.assertEqual(val, 456,
                         "numberValue from base config should be 123")
Ejemplo n.º 3
0
    def test_read_number(self):
        config = self.load_config()

        val = config.get_value("numberValue", dtype=int, required=True)

        self.assertIsInstance(val, int, "numberValue must be an int")
        self.assertEqual(val, 123,
                         "numberValue from base config should be 123")
Ejemplo n.º 4
0
    def test_read_missing_optional_prop(self):
        config = self.load_config()

        val = config.get_value("notThere", dtype=str, required=False)

        self.assertIsNone(val, "missing property should return None")