Skip to content

Commit f059465

Browse files
committed
Revert "Fix windows folder sep in script"
This reverts commit 2a0345a.
1 parent 0c33ceb commit f059465

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/test_qrqualitycheck.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,11 @@
1616
# See the License for the specific language governing permissions and
1717
# limitations under the License.
1818
# ---license-end
19-
#
20-
# Dependencies:
21-
# Python 3.9
22-
# pip install -r tests/requirements.txt
23-
#
24-
# Usage:
25-
# To run all tests: pytest
26-
# To run tests for a given country: pytest -C=<Country Code> . e.g. pytest -C=AT
2719

2820
import json
2921
from base64 import b64decode
3022
import base64
31-
import os
23+
from os import path
3224
from pathlib import Path
3325
from io import BytesIO
3426
from json import load
@@ -82,7 +74,7 @@ def pytest_generate_tests(metafunc):
8274
if "config_env" in metafunc.fixturenames:
8375
country_code = metafunc.config.getoption("country_code")
8476
file_name = metafunc.config.getoption("file_name")
85-
test_dir = os.dirname(os.path.dirname(os.path.abspath(__file__)))
77+
test_dir = path.dirname(path.dirname(path.abspath(__file__)))
8678
test_files = glob(
8779
str(Path(test_dir, country_code, "*", "*.png")), recursive=True)
8880
metafunc.parametrize("config_env", test_files, indirect=True)
@@ -271,8 +263,8 @@ def test_issuer_quality(config_env: Dict):
271263

272264
# If file path indicates JSON schema version, verify it against actual JSON schema version
273265
# E.g. "<countrycode>/1.0.0/VAC.png" will trigger schema version verification, whereas "<countrycode>/1.0.0/exceptions/VAC.png" will not
274-
if re.search("\\d\\.\\d\\.\\d", config_env[FILE_PATH].split(os.sep)[-2]):
275-
path_schema_version = config_env[FILE_PATH].split(os.sep)[-2]
266+
if re.search("\\d\\.\\d\\.\\d", config_env[FILE_PATH].split("/")[-2]):
267+
path_schema_version = config_env[FILE_PATH].split("/")[-2]
276268
dcc_schema_version = cose_payload[PAYLOAD_HCERT][PAYLOAD_ISSUER][VER]
277269
if path_schema_version != dcc_schema_version:
278270
fail("File path indicates {} but DCC contains {} JSON schema version".format(

0 commit comments

Comments
 (0)