Exemplo n.º 1
0
 def test_create_and_delete_service(self):
     scenario = basic.CreateAndDeleteService(self.context)
     service_type = "test_service_type"
     description = "test_description"
     fake_service = mock.MagicMock()
     scenario._service_create = mock.MagicMock(return_value=fake_service)
     scenario._delete_service = mock.MagicMock()
     scenario.run(service_type=service_type, description=description)
     scenario._service_create.assert_called_once_with(
         service_type, description)
     scenario._delete_service.assert_called_once_with(fake_service.id)
Exemplo n.º 2
0
    def test_create_and_delete_service(self):
        identity_service = self.mock_identity.return_value
        scenario = basic.CreateAndDeleteService(self.context)

        service_type = "test_service_type"
        description = "test_description"
        fake_service = identity_service.create_service.return_value

        scenario.run(service_type=service_type, description=description)

        identity_service.create_service.assert_called_once_with(
            service_type=service_type, description=description)
        identity_service.delete_service.assert_called_once_with(
            fake_service.id)