def testCorrectValueUpper(self): p = LogLevelParameter() d = {} c = {'logging': 'DEBUG'} self.assertTrue(p.fromFile(c, d)) self.assertEqual(d['logLevel'], logging.DEBUG)
def testCorrectValueLower(self): p = LogLevelParameter() d = {} c = {'logging': 'quiet'} self.assertTrue(p.fromFile(c, d)) self.assertEqual(d['logLevel'], logging.WARNING)
def testWrongValuefromFile(self): p = LogLevelParameter() d = {} c = {'logging': 'foo'} self.assertFalse(p.fromFile(c, d))