def __init__( self, name, vars, config, ): Visitor.__init__(self) self.name = name self.check_result = [] self.checked_count = 0 self.failed_count = 0 # read-only! self.vars = vars self.config = interpol(vars, config) self.current_context = None self.optionParser = DictConfig.DictConfigParser(self, isCaseSensitive=False, removeChars='-_', isLongestTokenMatch=True) self.hasVariable = has_variable(config)
def test_has_variable2(self): self.assertTrue(has_variable(['foo', {'quux': ['bal', '%bar']}]))
def test_has_variable4(self): self.assertTrue(has_variable(set(['foo', ' %bar'])))
def test_has_variable3(self): self.assertTrue(has_variable(['foo', {'quux': '%bar'}]))
def test_has_variable1(self): self.assertTrue(has_variable('foo %bar'))