Skip to content

Commit de65908

Browse files
Fixed doc and import
1 parent fc20a46 commit de65908

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

cwl_utils/file_formats.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
"""
2+
CWL file formats utilities.
3+
4+
For more information, please visit https://www.commonwl.org/user_guide/16-file-formats/
5+
"""
6+
17
from typing import List, Optional, Set, Union
28

39
from rdflib import Graph, OWL, RDFS, URIRef

tests/test_format.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import xml.sax
2-
from typing import Optional
2+
from typing import Any, Optional
33

44
import requests
55
from pytest import raises
@@ -8,10 +8,10 @@
88
from schema_salad.exceptions import ValidationException
99
from schema_salad.fetcher import DefaultFetcher
1010

11-
from cwl_utils.format import check_format
11+
from cwl_utils.file_formats import check_format
1212

1313

14-
def _create_file(format_: Optional[str] = None):
14+
def _create_file(format_: Optional[str] = None) -> Any:
1515
obj = {
1616
"class": "File",
1717
"basename": "example.txt",
@@ -25,7 +25,7 @@ def _create_file(format_: Optional[str] = None):
2525
return obj
2626

2727

28-
def _load_format(fetchurl: str):
28+
def _load_format(fetchurl: str) -> Graph:
2929
fetcher = DefaultFetcher({}, requests.Session())
3030
content = fetcher.fetch_text(fetchurl)
3131
graph = Graph()
@@ -38,15 +38,15 @@ def _load_format(fetchurl: str):
3838
return graph
3939

4040

41-
def test_check_format():
41+
def test_check_format() -> None:
4242
check_format(
4343
actual_file=_create_file(format_="http://edamontology.org/format_2330"),
4444
input_formats="http://edamontology.org/format_2330",
4545
ontology=_load_format("http://edamontology.org/EDAM.owl"),
4646
)
4747

4848

49-
def test_check_format_no_format():
49+
def test_check_format_no_format() -> None:
5050
with raises(ValidationException, match=r"File has no 'format' defined: .*"):
5151
check_format(
5252
actual_file=_create_file(),
@@ -55,7 +55,7 @@ def test_check_format_no_format():
5555
)
5656

5757

58-
def test_check_format_no_input_formats():
58+
def test_check_format_no_input_formats() -> None:
5959
with raises(ValidationException, match=r"File has an incompatible format: .*"):
6060
check_format(
6161
actual_file=_create_file(format_="http://edamontology.org/format_2330"),
@@ -64,7 +64,7 @@ def test_check_format_no_input_formats():
6464
)
6565

6666

67-
def test_check_format_no_ontology():
67+
def test_check_format_no_ontology() -> None:
6868
check_format(
6969
actual_file=_create_file(format_="http://edamontology.org/format_2330"),
7070
input_formats="http://edamontology.org/format_2330",

0 commit comments

Comments
 (0)