Mercurial > repos > guerler > springsuite
comparison planemo/lib/python3.7/site-packages/schema_salad/tests/test_fp.py @ 1:56ad4e20f292 draft
"planemo upload commit 6eee67778febed82ddd413c3ca40b3183a3898f1"
| author | guerler |
|---|---|
| date | Fri, 31 Jul 2020 00:32:28 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:d30785e31577 | 1:56ad4e20f292 |
|---|---|
| 1 from __future__ import absolute_import, print_function | |
| 2 | |
| 3 import pytest | |
| 4 import six | |
| 5 | |
| 6 from schema_salad.schema import load_and_validate, load_schema | |
| 7 from schema_salad.validate import ValidationException | |
| 8 | |
| 9 from .util import get_data | |
| 10 | |
| 11 | |
| 12 def test_fp(): | |
| 13 document_loader, avsc_names, schema_metadata, metaschema_loader = load_schema( | |
| 14 get_data(u"tests/test_schema/CommonWorkflowLanguage.yml") | |
| 15 ) | |
| 16 | |
| 17 for t in ( | |
| 18 "foreign/foreign_prop1.cwl", | |
| 19 "foreign/foreign_prop2.cwl", | |
| 20 "foreign/foreign_prop3.cwl", | |
| 21 "foreign/foreign_prop4.cwl", | |
| 22 "foreign/foreign_prop5.cwl", | |
| 23 "foreign/foreign_prop6.cwl", | |
| 24 "foreign/foreign_prop7.cwl", | |
| 25 ): | |
| 26 load_and_validate( | |
| 27 document_loader, | |
| 28 avsc_names, | |
| 29 six.text_type(get_data("tests/" + t)), | |
| 30 True, | |
| 31 strict_foreign_properties=False, | |
| 32 ) | |
| 33 | |
| 34 for t in ( | |
| 35 "foreign/foreign_prop1.cwl", | |
| 36 "foreign/foreign_prop2.cwl", | |
| 37 "foreign/foreign_prop4.cwl", | |
| 38 "foreign/foreign_prop5.cwl", | |
| 39 ): | |
| 40 with pytest.raises(ValidationException): | |
| 41 try: | |
| 42 print(t) | |
| 43 load_and_validate( | |
| 44 document_loader, | |
| 45 avsc_names, | |
| 46 six.text_type(get_data("tests/" + t)), | |
| 47 True, | |
| 48 strict_foreign_properties=True, | |
| 49 ) | |
| 50 except ValidationException as e: | |
| 51 print("\n", e) | |
| 52 raise |
