Skip to content

Commit

Permalink
Raise error if searching with incorrect parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
akim-ruslanov committed Jul 6, 2022
1 parent 81a272a commit 74b0510
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pycue/opencue/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,4 +381,8 @@ def _setOptions(criteria, options):
criteria.first_result = int(v)
elif k == "include_finished":
criteria.include_finished = v
elif len(k) == 0:
return criteria
else:
raise Exception("Criteria for search does not exist")
return criteria
2 changes: 1 addition & 1 deletion pycue/tests/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def testGetJobs(self, getStubMock):
jobs=job_pb2.JobSeq(jobs=[job_pb2.Job(name=TEST_JOB_NAME)]))
getStubMock.return_value = stubMock

jobsByShow = opencue.api.getJobs(show=[TEST_SHOW_NAME], all=True)
jobsByShow = opencue.api.getJobs(show=[TEST_SHOW_NAME])

stubMock.GetJobs.assert_called_with(
job_pb2.JobGetJobsRequest(
Expand Down

0 comments on commit 74b0510

Please sign in to comment.