Пример #1
0
    def test_set_than_get(self):
        settings = AppSettings(path="./settings_test.ini",
                               create_if_not_exists=False)

        settings.set_value("NEW-SECTION", "NEW-KEY", "VALUE")
        value = settings.get_value("NEW-SECTION", "NEW-KEY")

        self.assertEqual(value, "VALUE")
Пример #2
0
    def test_get_default_value(self):
        settings = AppSettings(path="./not-existent-file",
                               create_if_not_exists=False)
        distance = settings.get_value("ARGUMENTS", "MAX_DISTANCE_IN_KM")

        self.assertEqual(distance, "10")