Ejemplo n.º 1
0
    def setUp(self):
        super(TestRoleAdd, self).setUp()

        self.projects_mock.get.return_value = fakes.FakeResource(
            None,
            copy.deepcopy(identity_fakes.PROJECT),
            loaded=True,
        )

        self.users_mock.get.return_value = fakes.FakeResource(
            None,
            copy.deepcopy(identity_fakes.USER),
            loaded=True,
        )

        self.roles_mock.get.return_value = fakes.FakeResource(
            None,
            copy.deepcopy(identity_fakes.ROLE),
            loaded=True,
        )
        self.roles_mock.add_user_role.return_value = fakes.FakeResource(
            None,
            copy.deepcopy(identity_fakes.ROLE),
            loaded=True,
        )

        # Get the command object to test
        self.cmd = role.AddRole(self.app, None)
Ejemplo n.º 2
0
    def setUp(self):
        super(TestRoleAdd, self).setUp()

        self.projects_mock.get.return_value = self.fake_project

        self.users_mock.get.return_value = self.fake_user

        self.roles_mock.get.return_value = self.fake_role
        self.roles_mock.add_user_role.return_value = self.fake_role

        # Get the command object to test
        self.cmd = role.AddRole(self.app, None)