Skip to content

Commit e6d10c6

Browse files
NRL-518 Simplify test, fix lint warnings
1 parent 5a46d45 commit e6d10c6

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

layer/nrlf/core/tests/test_pydantic_errors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
from unittest.mock import Mock
2+
23
import pytest
4+
35
from nrlf.core.errors import ParseError
46
from nrlf.core.validators import DocumentReferenceValidator
57
from nrlf.tests.data import load_document_reference_json
68

9+
710
def test_validate_content_missing_attachment():
811
validator = DocumentReferenceValidator()
912
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")
@@ -31,6 +34,7 @@ def test_validate_content_missing_attachment():
3134
"expression": ["content.0.attachment"],
3235
}
3336

37+
3438
def test_validate_content_missing_content_type():
3539
validator = DocumentReferenceValidator()
3640
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")
@@ -58,6 +62,7 @@ def test_validate_content_missing_content_type():
5862
"expression": ["content.0.attachment.contentType"],
5963
}
6064

65+
6166
def test_validate_content_invalid_content_type():
6267
validator = DocumentReferenceValidator()
6368
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")

layer/nrlf/core/tests/test_validators.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -960,18 +960,8 @@ def test_validate_content_extension_invalid_code():
960960
validator = DocumentReferenceValidator()
961961
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")
962962

963-
document_ref_data["content"][0]["extension"][0] = {
964-
"url": "https://fhir.nhs.uk/England/StructureDefinition/Extension-England-ContentStability",
965-
"valueCodeableConcept": {
966-
"coding": [
967-
{
968-
"system": "https://fhir.nhs.uk/England/CodeSystem/England-NRLContentStability",
969-
"code": "invalid",
970-
"display": "invalid",
971-
}
972-
]
973-
},
974-
}
963+
content_extension = document_ref_data["content"][0]["extension"][0]
964+
content_extension["valueCodeableConcept"]["coding"][0]["code"] = "invalid"
975965

976966
result = validator.validate(document_ref_data)
977967

@@ -1523,6 +1513,7 @@ def test_validate_ssp_content_with_multiple_asids():
15231513
"expression": ["context.related"],
15241514
}
15251515

1516+
15261517
def test_validate_content_extension_invalid_code_and_display_mismatch():
15271518
validator = DocumentReferenceValidator()
15281519
document_ref_data = load_document_reference_json("Y05868-736253002-Valid")

0 commit comments

Comments
 (0)