Skip to content

Commit

Permalink
featt: Automated test: Only one type of certificate with one entry is…
Browse files Browse the repository at this point in the history
… allowed (#261)

* Updated known Issue List

* Updated known issue listing

* Enhanced Error Handling Capability to be able to flag invalid JSON files as knwon failures and updated Known Issue List.

* Enhanced Error Handling Capability to be able to flag invalid JSON files as knwon failures and updated Known Issue List.

* Update dgc-testdata-verification.yml

* Update dgc-testdata-verification.yml

* Update dgc-testdata-verification.yml

* Update dgc-testdata-verification.yml

* Update requirements.txt

* Update dgc-testdata-verification.yml

* Update dgc-testdata-verification.yml

* Update requirements.txt

* Enhanced error handling and reporting for test_picture_decode

* Fix for #213 -> test script is stricter than spec and Updated Known Issue List

* Updated Known Issue List

* Enhanced Test Coverage for SI and LV Test Dataset

* Revert test code changes for LV and SI

* Updated Known Issue List

* Update known_issues.csv

* Update known_issues.csv

* Only one type of certificate with one entry is allowed. Ref #161

Co-authored-by: Daniel Eder <danieleder@outlook.at>
  • Loading branch information
bhavin-qryptal and daniel-eder committed Jun 2, 2021
1 parent ef10c3a commit c0bec6e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/test_ehealth_certs.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ def test_cose_schema(config_env: Dict):
assert 1 in cose_payload[PAYLOAD_HCERT].keys()
hcert = cose_payload[PAYLOAD_HCERT][1]
schema_validate(hcert, _get_hcert_schema())
assert len(set(hcert.keys()) & {'v', 'r', 't'}) == 1, 'DGC adheres to schema but contains multiple certificates'
# assert len(set(hcert.keys()) & {'v', 'r', 't'}) == 1,
# 'DGC adheres to schema but contains multiple certificates'
assert len([key for key in hcert.keys() if key in ['v', 'r', 't']]) == 1, \
'DGC adheres to schema but contains multiple certificates'


def test_cose_json(config_env: Dict):
Expand Down Expand Up @@ -428,8 +431,10 @@ def test_expected_key_usage(config_env: Dict):
assert len(cose_payload[PAYLOAD_HCERT]) == 1
assert 1 in cose_payload[PAYLOAD_HCERT].keys()
hcert = cose_payload[PAYLOAD_HCERT][1]
assert len(set(hcert.keys()) & {'v', 'r', 't'}) == 1, \
'DGC adheres to schema but contains multiple certificates of different types'
assert len([key for key in hcert.keys() if key in ['v', 'r', 't']]) == 1, \
'DGC adheres to schema but contains multiple certificates'
# assert len(set(hcert.keys()) & {'v', 'r', 't'}) == 1, \
# 'DGC adheres to schema but contains multiple certificates of different types'
hcert_type = (set(hcert.keys()) & {'v', 'r', 't'}).pop()

if config_env[EXPECTED_RESULTS][EXPECTED_KEY_USAGE] and dsc_supported_operations:
Expand Down

0 comments on commit c0bec6e

Please sign in to comment.