comparison env/lib/python3.9/site-packages/cwltool/tests/test_http_input.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 import os
2 from pathlib import Path
3 from typing import List
4
5 from cwltool.pathmapper import PathMapper
6 from cwltool.utils import CWLObjectType
7
8
9 def test_http_path_mapping(tmp_path: Path) -> None:
10
11 input_file_path = "https://raw.githubusercontent.com/common-workflow-language/cwltool/main/tests/2.fasta"
12 base_file: List[CWLObjectType] = [
13 {
14 "class": "File",
15 "location": "https://raw.githubusercontent.com/common-workflow-language/cwltool/main/tests/2.fasta",
16 "basename": "chr20.fa",
17 }
18 ]
19 pathmap = PathMapper(base_file, os.getcwd(), str(tmp_path))._pathmap
20
21 assert input_file_path in pathmap
22 assert os.path.exists(pathmap[input_file_path].resolved)
23
24 with open(pathmap[input_file_path].resolved) as file:
25 contents = file.read()
26
27 assert ">Sequence 561 BP; 135 A; 106 C; 98 G; 222 T; 0 other;" in contents