def test_get_setting_name(self): s1 = Setting(NAME_AS_IS) s2 = Setting(NAME_TO_UPPER) s3 = Setting("setting") s4 = Setting(("list", "setting")) self.assertEqual(s1.get_setting_name("application", "test"), "test") self.assertEqual(s2.get_setting_name("application", "test"), "TEST") self.assertEqual(s3.get_setting_name("application", "test"), "setting") self.assertEqual(s4.get_setting_name("application", "test"), ("list", "setting"))
def test_set_value(self): class Test(object): pass s1 = Setting(NAME_AS_IS) s1.set_value(Test, "application", "test1", "value1") s2 = Setting(NAME_TO_UPPER) s2.set_value(Test, "application", "test2", "value2") s3 = Setting("setting") s3.set_value(Test, "application", "test3", "value3") self.assertEqual(Test.test1, "value1") self.assertEqual(Test.TEST2, "value2") self.assertEqual(Test.setting, "value3")