Esempio n. 1
0
 def test_create_and_list_ec2credentials(self):
     context = self._get_context()
     scenario = basic.CreateAndListEc2Credentials(context)
     scenario._create_ec2credentials = mock.MagicMock()
     scenario._list_ec2credentials = mock.MagicMock()
     scenario.run()
     scenario._create_ec2credentials.assert_called_once_with(
         "fake_user_id", "fake_tenant_id")
     scenario._list_ec2credentials.assert_called_with("fake_user_id")
Esempio n. 2
0
    def test_create_and_list_ec2credentials(self):
        identity_service = self.mock_identity.return_value

        scenario = basic.CreateAndListEc2Credentials(self.context)

        scenario.run()

        identity_service.create_ec2credentials.assert_called_once_with(
            self.context["user"]["id"],
            project_id=self.context["tenant"]["id"])
        identity_service.list_ec2credentials.assert_called_with(
            self.context["user"]["id"])