Skip to content

Commit

Permalink
feature/PI-581-create_mhs_device_with_drd Update add_device_reference…
Browse files Browse the repository at this point in the history
…_data_id event
  • Loading branch information
megan-bower4 committed Nov 11, 2024
1 parent 2188825 commit 9a75c91
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/api/createDeviceMessageHandlingSystem/src/v1/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def add_spine_mhs_questionnaire_response(
return mhs_device.add_questionnaire_response(spine_mhs_questionnaire_response)


def write_device(data: dict[str, CpmProduct], cache) -> CpmProduct:
def write_device(data: dict[str, Device], cache) -> Device:
mhs_device: Device = data[create_mhs_device]
repo = DeviceRepository(
table_name=cache["DYNAMODB_TABLE"], dynamodb_client=cache["DYNAMODB_CLIENT"]
Expand All @@ -155,8 +155,8 @@ def write_device(data: dict[str, CpmProduct], cache) -> CpmProduct:


def set_http_status(data, cache) -> tuple[HTTPStatus, str]:
device: Device = data[create_mhs_device]
return HTTPStatus.CREATED, device.state_exclude_tags()
mhs_device: Device = data[create_mhs_device]
return HTTPStatus.CREATED, mhs_device.state_exclude_tags()


steps = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ Feature: Create MHS Device - success scenarios
| deleted_on | << ignore >> |
| keys | [] |
| questionnaire_responses | << ignore >> |
# | device_reference_data | << ignore >> | should this be populated here?
| device_reference_data | << ignore >> |
And the response headers contain:
| name | value |
| Content-Type | application/json |
| Content-Length | 1133 |
| Content-Length | 1178 |
And I note the response field "$.id" as "device_id"
When I make a "GET" request with "default" headers to "ProductTeam/${ note(product_team_id) }/Product/${ note(product_id) }/Device/${ note(device_id) }"
Then I receive a status code "200" with body
Expand All @@ -74,7 +74,7 @@ Feature: Create MHS Device - success scenarios
| tags.0.0.0 | ${ note(party_key_tag) } |
| tags.0.0.1 | ${ note(party_key_value) } |
| questionnaire_responses | << ignore >> |
# | device_reference_data.${ note(message_set_drd_id) }.0 | * | How to check a dict
| device_reference_data | << ignore >> |
And the response headers contain:
| name | value |
| Content-Type | application/json |
Expand Down
4 changes: 2 additions & 2 deletions src/layers/domain/core/device/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,10 @@ def add_questionnaire_response(
def add_device_reference_data_id(
self, device_reference_data_id: str, path_to_data: list[str]
) -> DeviceReferenceDataIdAddedEvent:
self.device_reference_data[device_reference_data_id] = path_to_data

return DeviceReferenceDataIdAddedEvent(
id=self.id,
device_reference_data={device_reference_data_id: path_to_data},
id=self.id, device_reference_data=self.device_reference_data
)

def is_active(self):
Expand Down

0 comments on commit 9a75c91

Please sign in to comment.