Skip to content

Commit

Permalink
Merge pull request #129 from Crown-Commercial-Service/feature/DMP-685…
Browse files Browse the repository at this point in the history
…-add-group-by-user

DMP-685 - Add find users with evaluation questions
  • Loading branch information
tim-s-ccs authored Aug 19, 2024
2 parents 12e31bd + eedd96e commit 9a5c416
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dmapiclient/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '26.5.0'
__version__ = '26.6.0'

from .errors import APIError, HTTPError, InvalidResponse # noqa
from .errors import REQUEST_ERROR_STATUS_CODE, REQUEST_ERROR_MESSAGE # noqa
Expand Down
14 changes: 2 additions & 12 deletions dmapiclient/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1344,11 +1344,6 @@ def find_communications(
message_text=None,
sort_by=None
):
warnings.warn(
"The output of 'find_communications' is paginated. Use 'find_communications_iter' instead.",
DeprecationWarning
)

params = {
'page': page,
'framework': framework,
Expand Down Expand Up @@ -1563,11 +1558,6 @@ def find_evaluator_questions(
assigned=True,
page=None,
):
warnings.warn(
"The output of 'find_evaluator_questions' is paginated. Use 'find_evaluator_questions_iter' instead.",
DeprecationWarning
)

params = {
'framework': framework,
'lot': lot,
Expand All @@ -1584,9 +1574,9 @@ def find_evaluator_questions(
find_evaluator_questions_iter = make_iter_method('find_evaluator_questions', 'evaluatorQuestions')
find_evaluator_questions_iter.__name__ = str("find_evaluator_questions_iter")

def group_evaluator_questions_by_lot_with_status(self, framework):
def find_evaluator_question_users(self, framework, lot):
return self._get(
f"/evaluator-questions/{framework}/group-by/lot/with-status"
f"/evaluator-questions/{framework}/{lot}/users"
)

def get_evaluator_question(self, evaluator_question_id):
Expand Down
11 changes: 11 additions & 0 deletions tests/test_data_api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4023,6 +4023,17 @@ def test_find_evaluator_questions_adds_assigned_parameter(self, data_client, rmo
assert result == {"evaluatorQuestions": "result"}
assert rmock.called

def test_find_evaluator_question_users_response(self, data_client, rmock):
rmock.get(
"http://baseurl/evaluator-questions/g-cloud-6/g-things/users",
json={"usersWithEvaluatorQuestions": "result"},
status_code=200)

result = data_client.find_evaluator_question_users('g-cloud-6', 'g-things')

assert result == {"usersWithEvaluatorQuestions": "result"}
assert rmock.called

def test_get_lot_questions_response(self, data_client, rmock):
rmock.get(
"http://baseurl/evaluator-questions/1234",
Expand Down

0 comments on commit 9a5c416

Please sign in to comment.