def test_clean_ctx_to_lists(self):
     configuration = DeviceConfiguration._load_yaml(sample_configuration, is_file_path=False)
     assert_is_instance(configuration, dict)
     command01 = configuration['commands'][0]
     command02 = configuration['commands'][1]
     assert_is_instance(command01['context'], basestring)
     assert_is_instance(command02['context'], list)
     DeviceConfiguration._command_ctx_to_list(configuration)
     assert_is_instance(command01['context'], list)
     assert_is_instance(command02['context'], list)
Ejemplo n.º 2
0
 def setup(self):
     self.configuration = DeviceConfiguration.get(sample_configuration, is_file_path=False)
     self.configuration['commands'][3]['delay'] = 0
     self.terminal = MockTerminal()
     self.context_manager = ContextManager()
     base_ctx = DeviceContext('base')
     base_ctx.prompt = 'device#'
     self.context_manager.add(base_ctx)
     self.command_manager = CommandManager(self.configuration)
     self.run = partial(self.command_manager.run, self.terminal, self.context_manager)
Ejemplo n.º 3
0
 def setup(self):
     self.configuration = DeviceConfiguration.get(sample_configuration, is_file_path=False)
     self.terminal = MockTerminal()
     self.context_manager = ContextManager()
     self.cmd = DeviceCommand(self.configuration.get('commands')[3])
Ejemplo n.º 4
0
 def setup(self):
     self.terminal = MockTerminal()
     self.configuration = DeviceConfiguration.get(sample_configuration, is_file_path=False)