コード例 #1
0
 def testAppend(self):
     dc = DeviceConfigurations()
     try:
         dc.append(self.config_one)
     except Exception, e:
         logging.error('FAILURE: append failed ' + str(dc.getContexts()) +
                       ': ' + str(e))
コード例 #2
0
 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'
コード例 #3
0
 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'