Exemplo n.º 1
0
 def test_create_and_delete_role(self):
     scenario = basic.CreateAndDeleteRole(self.context)
     fake_role = mock.MagicMock()
     scenario._role_create = mock.MagicMock(return_value=fake_role)
     scenario._role_delete = mock.MagicMock()
     scenario.run()
     scenario._role_create.assert_called_once_with()
     scenario._role_delete.assert_called_once_with(fake_role.id)
Exemplo n.º 2
0
    def test_create_and_delete_role(self):
        fake_role = mock.MagicMock()
        self.mock_identity.return_value.create_role.return_value = fake_role

        scenario = basic.CreateAndDeleteRole(self.context)
        scenario.run()

        self.mock_identity.return_value.create_role.assert_called_once_with()
        self.mock_identity.return_value.delete_role.assert_called_once_with(
            fake_role.id)