def test_purge_succeeds(self): ret_val = {"success": True} self.run_api_call.return_value = ret_val self.assertEqual( api_interface.purge_user(sentinel.api_root, self.test_user), ret_val)
def test_purge_succeeds(self): ret_val = {"success" : True} self.run_api_call.return_value = ret_val self.assertEqual(api_interface.purge_user(sentinel.api_root, self.test_user), ret_val)
def test_purge_connection_problem(self): self.run_api_call.side_effect = MockException("DEADBEEF") with self.assertRaises(api_interface.ManipulateUserFailed) as cm: retval = api_interface.purge_user(sentinel.api_root, self.test_user) the_exception = cm.exception self.assertEqual(str(the_exception), "DEADBEEF")
def test_purge_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.purge_user(sentinel.api_root, self.test_user) the_exception = cm.exception self.assertEqual(str(the_exception), "DEADBEEF")
def test_purge_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.purge_user(sentinel.api_root, self.test_user) the_exception = cm.exception self.assertEqual(str(the_exception), "DEADBEEF")