Exemplo n.º 1
0
    def test_stop_instance_running_check_mode(self):
        mock_module = mock.MagicMock(
            params=copy.deepcopy(self.mockModule.params),
            check_mode=True,
        )

        self.assertEqual((True, 16, 'stopped(check mode)'),
                         nifcloud.stop_instance(mock_module, 16))
Exemplo n.º 2
0
 def test_stop_instance_running(self):
     with mock.patch('requests.get', self.mockRequestsGetStopInstance):
         with mock.patch('nifcloud.get_instance_state',
                         self.mockGetInstanceState80):
             self.assertEqual(
                 (True, 80, 'stopped'),
                 nifcloud.stop_instance(self.mockModule, 16)
             )
Exemplo n.º 3
0
 def test_stop_instance_stopped(self):
     self.assertEqual((False, 80, 'stopped'),
                      nifcloud.stop_instance(self.mockModule, 80))