예제 #1
0
 def test_regist_instance_present(self):
     with mock.patch('requests.get',
                     self.mockRequestsGetRegisterInstancesWithLoadBalancer):
         with mock.patch('nifcloud_lb.is_present_in_load_balancer',
                         mock.MagicMock(return_value=True)):
             self.assertEqual(
                 (False, 'present'),
                 nifcloud_lb.regist_instance(self.mockModule)
             )
예제 #2
0
    def test_regist_instance_check_mode(self):
        mockModule = mock.MagicMock(
            params=copy.deepcopy(self.mockModule.params),
            check_mode=True,
        )

        self.assertEqual(
            (True, 'absent'),
            nifcloud_lb.regist_instance(mockModule)
        )