Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ jobs:
run: |
python -m pytest tests/unit/ --cov=cdisc_rules_engine --cov-fail-under=75
python -m pytest tests/QARegressionTests/
python -m pytest -m regression tests/QARegressionTests/test_Issues
20 changes: 10 additions & 10 deletions tests/QARegressionTests/globals.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
issue_datails_sheet = "Issue Details"
dataset_details_sheet = "Dataset Details"
entity_details_sheet = "Entity Details"
rules_report_sheet = "Rules Report"
issue_sheet_coreid_column = "A"
dataset_sheet_dataset_column = "A"
rules_sheet_rule_status_column = "F"
issue_sheet_record_column = "G"
issue_sheet_variable_column = "I"
issue_sheet_values_column = "J"
issue_datails_sheet = "Issue Details"
dataset_details_sheet = "Dataset Details"
entity_details_sheet = "Entity Details"
rules_report_sheet = "Rules Report"
issue_sheet_coreid_column = "A"
dataset_sheet_dataset_column = "A"
rules_sheet_rule_status_column = "F"
issue_sheet_record_column = "F"
issue_sheet_variable_column = "H"
issue_sheet_values_column = "I"
80 changes: 40 additions & 40 deletions tests/QARegressionTests/test_Issues/test_CoreIssue1204.py
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
import subprocess
import pytest
from conftest import get_python_executable


@pytest.mark.regression
def test_non_existing_dataset_shows_helpful_error():
"""Test that the engine displays a helpful error message if dataset files are not found"""
command = [
get_python_executable(),
"-m",
"core",
"validate",
"-s",
"sdtmig",
"-v",
"3.4",
"-dp",
"ds.json",
"-dp",
"ds2.json",
]

process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()

stderr_text = stderr.decode()
stdout_text = stdout.decode()

assert process.returncode == 2, "Expected non-zero exit code"
assert (
"FileNotFoundError" not in stderr_text
), "Should not show FileNotFoundError crash"
assert (
"Failed to execute script" not in stderr_text
), "Should not show script execution failure"
assert "Files ds.json, ds2.json are not found" in stderr_text, (
f"Expected helpful error message about non-existing dataset files. "
f"stderr: {stderr_text}, stdout: {stdout_text}"
)
import subprocess
import pytest
from conftest import get_python_executable
@pytest.mark.regression
def test_non_existing_dataset_shows_helpful_error():
"""Test that the engine displays a helpful error message if dataset files are not found"""
command = [
get_python_executable(),
"-m",
"core",
"validate",
"-s",
"sdtmig",
"-v",
"3.4",
"-dp",
"ds.json",
"-dp",
"ds2.json",
]
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
stderr_text = stderr.decode()
stdout_text = stdout.decode()
assert process.returncode == 2, "Expected non-zero exit code"
assert (
"FileNotFoundError" not in stderr_text
), "Should not show FileNotFoundError crash"
assert (
"Failed to execute script" not in stderr_text
), "Should not show script execution failure"
assert "Files ds.json, ds2.json are not found" in stderr_text, (
f"Expected helpful error message about non-existing dataset files. "
f"stderr: {stderr_text}, stdout: {stdout_text}"
)
Loading
Loading