IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Verified Commit 7f1662eb authored by Emi Simpson's avatar Emi Simpson
Browse files

[new arch] New test for removing an owner

parent e66f75e5
Pipeline #867 passed with stage
in 1 minute
......@@ -304,3 +304,21 @@ class TestQueries(unittest.TestCase):
Exception,
update_project.handle_results,
SqlIntegrityError(SqlErrorCode.BAD_NULL_ERROR, 'unexpected'))
def test_remove_owner(self):
add_owner = RemoveOwner(ProjectID(UncheckedPID(1312)), UserID(3336))
self.assertEqual(
add_owner.get_query(),
QueryRequest(
'DELETE FROM owners WHERE user_id = %s AND project_id = %s;' ,
(3336, 1312)))
self.assertEqual(
add_owner.handle_results(QueryResult(1, -1, panic, panic)),
Finished(None))
self.assertEqual(
add_owner.handle_results(none_result),
Error(None))
self.assertRaises(
Exception,
add_owner.handle_results,
SqlIntegrityError(SqlErrorCode.BAD_NULL_ERROR, 'unexpected'))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment