def test_wait_until_removed(self, mock_juju_status, mock_juju): # The function waits for the service to be removed. mock_juju_status.side_effect = ( {"services": {self.service: {}, "another-service": {}}}, {"services": {"another-service": {}}}, ) juju_destroy_service(self.service) self.assertEqual(2, mock_juju_status.call_count) mock_juju.assert_called_once_with("destroy-service", self.service)
def test_wait_until_removed(self, mock_juju_status, mock_juju): # The function waits for the service to be removed. mock_juju_status.side_effect = ( { 'services': { self.service: {}, 'another-service': {} } }, { 'services': { 'another-service': {} } }, ) juju_destroy_service(self.service) self.assertEqual(2, mock_juju_status.call_count) mock_juju.assert_called_once_with('destroy-service', self.service)
def test_service_destroyed(self, mock_juju_status, mock_juju): # The juju destroy-service command is correctly called. mock_juju_status.return_value = {} juju_destroy_service(self.service) self.assertEqual(1, mock_juju_status.call_count) mock_juju.assert_called_once_with("destroy-service", self.service)
def test_service_destroyed(self, mock_juju_status, mock_juju): # The juju destroy-service command is correctly called. mock_juju_status.return_value = {} juju_destroy_service(self.service) self.assertEqual(1, mock_juju_status.call_count) mock_juju.assert_called_once_with('destroy-service', self.service)