Beispiel #1
0
    def test_deactivate_succeeds(self):
        ret_val = {"success": True}
        self.run_api_call.return_value = ret_val

        self.assertEqual(
            api_interface.deactivate_user(sentinel.api_root, self.test_user),
            ret_val)
Beispiel #2
0
    def test_deactivate_succeeds(self):
        ret_val = {"success" : True}
        self.run_api_call.return_value = ret_val

        self.assertEqual(api_interface.deactivate_user(sentinel.api_root,
                                                       self.test_user),
                         ret_val)
Beispiel #3
0
    def test_deactivate_connection_problem(self):
        self.run_api_call.side_effect = MockException("DEADBEEF")

        with self.assertRaises(api_interface.ManipulateUserFailed) as cm:
            retval = api_interface.deactivate_user(sentinel.api_root,
                                                   self.test_user)

        the_exception = cm.exception
        self.assertEqual(str(the_exception), "DEADBEEF")
Beispiel #4
0
    def test_deactivate_connection_problem(self):
        self.run_api_call.side_effect = MockException("DEADBEEF")

        with self.assertRaises(api_interface.ManipulateUserFailed) as cm:
            retval = api_interface.deactivate_user(sentinel.api_root,
                                                   self.test_user)

        the_exception = cm.exception
        self.assertEqual(str(the_exception), "DEADBEEF")
Beispiel #5
0
    def test_deactivate_fails(self):
        ret_val = {"success" : False,
                   "reason"  : "DEADBEEF",
                   }
        self.run_api_call.return_value = ret_val

        with self.assertRaises(api_interface.ManipulateUserFailed) as cm:
            retval = api_interface.deactivate_user(sentinel.api_root,
                                                   self.test_user)

        the_exception = cm.exception
        self.assertEqual(str(the_exception), "DEADBEEF")
Beispiel #6
0
    def test_deactivate_fails(self):
        ret_val = {
            "success": False,
            "reason": "DEADBEEF",
        }
        self.run_api_call.return_value = ret_val

        with self.assertRaises(api_interface.ManipulateUserFailed) as cm:
            retval = api_interface.deactivate_user(sentinel.api_root,
                                                   self.test_user)

        the_exception = cm.exception
        self.assertEqual(str(the_exception), "DEADBEEF")