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

Verified Commit 9e27d4c0 authored by Emi Simpson's avatar Emi Simpson
Browse files

[new arch] Test ValidateProjectOwned

parent a170a04c
......@@ -177,6 +177,26 @@ class TestQueries(unittest.TestCase):
delete_source.handle_results,
SqlIntegrityError(SqlErrorCode.BAD_NULL_ERROR, 'unexpected error'))
def test_validate_project_owned(self):
validate_proj = ValidateProjectOwned(UncheckedPID(1312), UserID(3336))
self.assertEqual(
validate_proj.get_query(),
QueryRequest('''
SELECT project_id FROM owners
WHERE project_id = %s
AND user_id = %s;
''', (1312, 3336)))
self.assertEqual(
validate_proj.handle_results(QueryResult(1, -1, *next_and_all([(1312,)]))),
Finished(ProjectID(UncheckedPID(1312))))
self.assertEqual(
validate_proj.handle_results(none_result),
Error(None))
self.assertRaises(
Exception,
validate_proj.handle_results,
SqlIntegrityError(SqlErrorCode.BAD_NULL_ERROR, 'unexpected'))
def test_retreive_project_info_if_owned(self):
retreive_info = RetreiveProjectInfoIfOwned(UncheckedPID(100), UserID(200))
self.assertEqual(
......
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