Repository navigation
Expand file tree
/
Copy pathremote.py
More file actions
106 lines (102 loc) · 3.95 KB
/
Copy pathremote.py
File metadata and controls
106 lines (102 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
from pathlib import Path
from nextstrain.cli.remote.nextstrain_dot_org import organize_files
def pytest_organize_files():
assert (
organize_files({
Path("ncov_open_global.json"),
Path("ncov_open_global_root-sequence.json"),
Path("ncov_open_global_tip-frequencies.json"),
Path("ncov_open_north-america.json"),
Path("ncov_open_north-america_root-sequence.json"),
Path("ncov_open_north-america_tip-frequencies.json"),
Path("ncov_gisaid_global.json"),
})
==
(
{
"ncov/open/global": {
"application/vnd.nextstrain.dataset.main+json": Path("ncov_open_global.json"),
"application/vnd.nextstrain.dataset.root-sequence+json": Path("ncov_open_global_root-sequence.json"),
"application/vnd.nextstrain.dataset.tip-frequencies+json": Path("ncov_open_global_tip-frequencies.json"),
},
"ncov/open/north-america": {
"application/vnd.nextstrain.dataset.main+json": Path("ncov_open_north-america.json"),
"application/vnd.nextstrain.dataset.root-sequence+json": Path("ncov_open_north-america_root-sequence.json"),
"application/vnd.nextstrain.dataset.tip-frequencies+json": Path("ncov_open_north-america_tip-frequencies.json"),
},
"ncov/gisaid/global": {
"application/vnd.nextstrain.dataset.main+json": Path("ncov_gisaid_global.json"),
},
},
{},
[],
)
)
assert (
organize_files({
Path("auspice/A.json"),
Path("auspice/A_root-sequence.json"),
Path("auspice/A_tip-frequencies.json"),
Path("auspice/A_B.json"),
Path("auspice/A_B_root-sequence.json"),
Path("narratives/hello_world.md"),
Path("narratives/hello_universe.md"),
Path("group-overview.md"),
Path("group-logo.png"),
})
==
(
{
"A": {
"application/vnd.nextstrain.dataset.main+json": Path("auspice/A.json"),
"application/vnd.nextstrain.dataset.root-sequence+json": Path("auspice/A_root-sequence.json"),
"application/vnd.nextstrain.dataset.tip-frequencies+json": Path("auspice/A_tip-frequencies.json"),
},
"A/B": {
"application/vnd.nextstrain.dataset.main+json": Path("auspice/A_B.json"),
"application/vnd.nextstrain.dataset.root-sequence+json": Path("auspice/A_B_root-sequence.json"),
},
},
{
"hello/world": {
"text/vnd.nextstrain.narrative+markdown": Path("narratives/hello_world.md"),
},
"hello/universe": {
"text/vnd.nextstrain.narrative+markdown": Path("narratives/hello_universe.md"),
},
},
[
Path("group-logo.png"),
Path("group-overview.md"),
],
)
)
assert (
organize_files({
Path("A_tree.json"),
Path("A_meta.json"),
Path("A_tip-frequencies.json"),
Path("A_B.md"),
Path("A_C.md"),
})
==
(
{
"A": {
"application/vnd.nextstrain.dataset.tip-frequencies+json": Path("A_tip-frequencies.json"),
},
},
{
"A/B": {
"text/vnd.nextstrain.narrative+markdown": Path("A_B.md"),
},
"A/C": {
"text/vnd.nextstrain.narrative+markdown": Path("A_C.md"),
},
},
[
Path("A_meta.json"),
Path("A_tree.json"),
],
)
)