def testAppend(self): dc = DeviceConfigurations() try: dc.append(self.config_one) except Exception, e: logging.error('FAILURE: append failed ' + str(dc.getContexts()) + ': ' + str(e))
def testConfigInstantiate(self): dc = None dc = DeviceConfigurations() dc.setConfig(self.config_line) a = dc.getContexts() assert len(a) == 1 and a[ 0] == default_context, 'single config on intantiate doenst work'
def testContext(self): dc = DeviceConfigurations() string = 'test_context' dc.setConfig(self.config_one, context=string) assert dc.getContexts()[0] == string, 'context names do not match'