Ejemplo n.º 1
0
 def test_create_probe_1(self, mock_f1, mock_f2):
     '''Exception raises'''
     cmd.create_probe(self.ctx, self.probe)
     rollback_fn = self.ctx.add_rollback.call_args[0][0]
     rollback_fn(False)
     self.assertTrue(mock_f2.called)
     mock_f2.assert_called_once_with(self.ctx, self.probe)
Ejemplo n.º 2
0
 def test_create_probe_0(self, mock_f1, mock_f2):
     '''No exception should raise'''
     cmd.create_probe(self.ctx, self.probe)
     self.assertTrue(self.ctx.device.create_probe.called)
     self.assertTrue(mock_f1.called)
     self.assertFalse(mock_f2.called)
     mock_f1.assert_called_once_with(self.ctx.conf, self.probe['id'],
             {'deployed': True})
Ejemplo n.º 3
0
 def test_create_probe_1(self, mock_f1, mock_f2):
     cmd.create_probe(self.ctx, self.probe)
     rollback_fn = self.ctx.add_rollback.call_args[0][0]
     rollback_fn(False)
     self.assertTrue(mock_f2.called)
Ejemplo n.º 4
0
 def test_create_probe_0(self, mock_f1, mock_f2):
     cmd.create_probe(self.ctx, self.probe)
     self.assertTrue(self.ctx.device.create_probe.called)
     self.assertTrue(mock_f1.called)