Skip to content

Commit ba52fe6

Browse files
committed
Try to work around windows path issues
1 parent 9a229f5 commit ba52fe6

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

cwltest/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import ruamel.yaml.scanner as yamlscanner
1818
import schema_salad.ref_resolver
1919
import schema_salad.schema
20+
import schema_salad.avro.schema
2021
import pkg_resources # part of setuptools
2122

2223
import junit_xml
@@ -355,12 +356,16 @@ def main(): # type: () -> int
355356
return 1
356357

357358
schema_resource = pkg_resources.resource_stream(__name__, "cwltest-schema.yml")
358-
cache = {"https://w3id.org/cwl/cwltest/cwltest-schema.yml": schema_resource.read()}
359+
cache = {"https://w3id.org/cwl/cwltest/cwltest-schema.yml": schema_resource.read().decode("utf-8")}
359360
(document_loader,
360361
avsc_names,
361362
schema_metadata,
362363
metaschema_loader) = schema_salad.schema.load_schema("https://w3id.org/cwl/cwltest/cwltest-schema.yml", cache=cache)
363364

365+
if not isinstance(avsc_names, schema_salad.avro.schema.Names):
366+
print(avsc_names)
367+
return 1
368+
364369
tests, metadata = schema_salad.schema.load_and_validate(document_loader, avsc_names, args.test, True)
365370

366371
failures = 0

cwltest/tests/test_categories.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
from .util import run_with_mock_cwl_runner, get_data
88
import xml.etree.ElementTree as ET
9-
9+
import schema_salad.ref_resolver
1010

1111
class TestCategories(unittest.TestCase):
1212
maxDiff = None
1313

1414
def test_unsupported_with_required_tests(self):
15-
args = ["--test", get_data("tests/test-data/required-unsupported.yml")]
15+
args = ["--test", schema_salad.ref_resolver.file_uri(get_data("tests/test-data/required-unsupported.yml"))]
1616
try:
1717
cwd = os.getcwd()
1818
os.chdir(get_data("tests/test-data/"))
@@ -47,7 +47,7 @@ def test_unsupported_with_required_tests(self):
4747
)
4848

4949
def test_unsupported_with_optional_tests(self):
50-
args = ["--test", get_data("tests/test-data/optional-unsupported.yml")]
50+
args = ["--test", schema_salad.ref_resolver.file_uri(get_data("tests/test-data/optional-unsupported.yml"))]
5151
error_code, stdout, stderr = run_with_mock_cwl_runner(args)
5252
self.assertEqual(error_code, 0)
5353
self.assertEqual(
@@ -58,7 +58,7 @@ def test_unsupported_with_optional_tests(self):
5858
)
5959

6060
def test_error_with_optional_tests(self):
61-
args = ["--test", get_data("tests/test-data/optional-error.yml")]
61+
args = ["--test", schema_salad.ref_resolver.file_uri(get_data("tests/test-data/optional-error.yml"))]
6262
error_code, stdout, stderr = run_with_mock_cwl_runner(args)
6363
self.assertEqual(error_code, 1)
6464
self.assertIn("1 failures", stderr)
@@ -67,7 +67,7 @@ def test_category_in_junit_xml(self):
6767
junit_xml_report = get_data("tests/test-data/junit-report.xml")
6868
args = [
6969
"--test",
70-
get_data("tests/test-data/optional-error.yml"),
70+
schema_salad.ref_resolver.file_uri(get_data("tests/test-data/optional-error.yml")),
7171
"--junit-xml",
7272
junit_xml_report,
7373
]

0 commit comments

Comments
 (0)