예제 #1
0
    def test_stage_apply_configuration1(self):
        self.device.configure = Mock(side_effect=KeyError('negative test'))
        self.device.destroy = Mock(return_value="")
        self.device.connect = Mock(return_value=self.raw_output.connect)

        # Execute stage: apply_configuration
        with self.assertRaises(AEtestFailedSignal):
            apply_configuration(self.section, self.steps, self.device,
                                **self.device.clean.apply_configuration)
예제 #2
0
 def test_stage_apply_configuration2(self):
     self.device.configure = Mock(side_effect=StateMachineError('negative test'))
     self.device.destroy = Mock(return_value="")
     self.device.connect = Mock(return_value=self.raw_output.connect)
     self.device.execute = Mock(return_value="")
     
     # Execute stage: apply_configuration
     with self.assertRaises(TerminateStepSignal):
         apply_configuration(self.section, self.steps, self.device,
                             **self.device.clean.apply_configuration)
예제 #3
0
 def test_stage_apply_configuration(self):
     self.device.configure = Mock(side_effect=StateMachineError('device hostname changed'))
     self.device.destroy = Mock(return_value="")
     self.device.connect = Mock(return_value=self.raw_output.connect)
     self.device.execute = Mock(side_effect=pos_execute)
     
     # Execute stage: apply_configuration
     with self.assertRaises(AEtestPassedSignal):
         apply_configuration(self.section, self.steps, self.device,
                             **self.device.clean.apply_configuration)