ciocore 6.3.2rc1__py2.py3-none-any.whl → 6.4.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ciocore might be problematic. Click here for more details.
- ciocore/VERSION +1 -1
- ciocore/__about__.py +3 -20
- ciocore/api_client.py +116 -236
- ciocore/cli/__init__.py +3 -0
- ciocore/cli/conductor.py +206 -0
- ciocore/config.py +44 -50
- ciocore/data.py +131 -85
- ciocore/downloader.py +64 -46
- ciocore/hardware_set.py +99 -326
- ciocore/package_environment.py +74 -48
- ciocore/package_tree.py +377 -300
- ciocore/uploader/_uploader.py +2 -6
- ciocore-6.4.0.data/scripts/conductor +19 -0
- ciocore-6.4.0.data/scripts/conductor.bat +13 -0
- {ciocore-6.3.2rc1.dist-info → ciocore-6.4.0.dist-info}/METADATA +12 -35
- ciocore-6.4.0.dist-info/RECORD +51 -0
- {ciocore-6.3.2rc1.dist-info → ciocore-6.4.0.dist-info}/WHEEL +1 -1
- tests/instance_type_fixtures.py +9 -43
- tests/mocks/api_client_mock.py +31 -0
- tests/test_hardware_set.py +4 -50
- ciocore/cli.py +0 -336
- ciocore/dev_inst_tagger.py +0 -120
- ciocore/docsite/404.html +0 -723
- ciocore/docsite/apidoc/api_client/index.html +0 -2590
- ciocore/docsite/apidoc/apidoc/index.html +0 -868
- ciocore/docsite/apidoc/config/index.html +0 -1562
- ciocore/docsite/apidoc/data/index.html +0 -1550
- ciocore/docsite/apidoc/hardware_set/index.html +0 -2324
- ciocore/docsite/apidoc/package_environment/index.html +0 -1430
- ciocore/docsite/apidoc/package_tree/index.html +0 -2310
- ciocore/docsite/assets/_mkdocstrings.css +0 -16
- ciocore/docsite/assets/images/favicon.png +0 -0
- ciocore/docsite/assets/javascripts/bundle.4e31edb1.min.js +0 -29
- ciocore/docsite/assets/javascripts/bundle.4e31edb1.min.js.map +0 -8
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ar.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.da.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.de.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.du.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.es.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.fi.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.fr.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.hi.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.hu.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.hy.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.it.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ja.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.jp.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.kn.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ko.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.multi.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.nl.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.no.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.pt.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ro.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ru.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.sa.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.sv.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.ta.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.te.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.th.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.tr.min.js +0 -18
- ciocore/docsite/assets/javascripts/lunr/min/lunr.vi.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/min/lunr.zh.min.js +0 -1
- ciocore/docsite/assets/javascripts/lunr/tinyseg.js +0 -206
- ciocore/docsite/assets/javascripts/lunr/wordcut.js +0 -6708
- ciocore/docsite/assets/javascripts/workers/search.dfff1995.min.js +0 -42
- ciocore/docsite/assets/javascripts/workers/search.dfff1995.min.js.map +0 -8
- ciocore/docsite/assets/stylesheets/main.83068744.min.css +0 -1
- ciocore/docsite/assets/stylesheets/main.83068744.min.css.map +0 -1
- ciocore/docsite/assets/stylesheets/palette.ecc896b0.min.css +0 -1
- ciocore/docsite/assets/stylesheets/palette.ecc896b0.min.css.map +0 -1
- ciocore/docsite/cmdline/docs/index.html +0 -834
- ciocore/docsite/cmdline/downloader/index.html +0 -897
- ciocore/docsite/cmdline/packages/index.html +0 -841
- ciocore/docsite/cmdline/uploader/index.html +0 -950
- ciocore/docsite/how-to-guides/index.html +0 -831
- ciocore/docsite/index.html +0 -853
- ciocore/docsite/logo.png +0 -0
- ciocore/docsite/objects.inv +0 -0
- ciocore/docsite/search/search_index.json +0 -1
- ciocore/docsite/sitemap.xml +0 -3
- ciocore/docsite/sitemap.xml.gz +0 -0
- ciocore/docsite/stylesheets/extra.css +0 -26
- ciocore/docsite/stylesheets/tables.css +0 -170
- ciocore/package_query.py +0 -171
- ciocore-6.3.2rc1.dist-info/RECORD +0 -115
- ciocore-6.3.2rc1.dist-info/entry_points.txt +0 -2
- tests/test_cli.py +0 -161
- tests/test_downloader.py +0 -56
- {ciocore-6.3.2rc1.dist-info → ciocore-6.4.0.dist-info}/top_level.txt +0 -0
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Any CSS included here will be global. The classic template
|
|
3
|
-
* bundles Infima by default. Infima is a CSS framework designed to
|
|
4
|
-
* work well for content-centric websites.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/* You can override the default Infima variables here. */
|
|
8
|
-
:root {
|
|
9
|
-
--ifm-color-primary: #96621f;
|
|
10
|
-
--ifm-color-primary-dark: #8c5227;
|
|
11
|
-
--ifm-color-primary-darker: #7a4217;
|
|
12
|
-
--ifm-color-primary-darkest: #6c3912;
|
|
13
|
-
--ifm-color-primary-light: #7b5e16;
|
|
14
|
-
--ifm-color-primary-lighter: #a57b13;
|
|
15
|
-
--ifm-color-primary-lightest: #b9880d;
|
|
16
|
-
--ifm-code-font-size: 95%;
|
|
17
|
-
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
|
21
|
-
[data-theme='dark'] {
|
|
22
|
-
--ifm-color-primary: #c6893a;
|
|
23
|
-
--ifm-color-primary-dark: #c67639;
|
|
24
|
-
--ifm-color-primary-darker: #aa5f27;
|
|
25
|
-
--ifm-color-primary-darkest: #84491b;
|
|
26
|
-
--ifm-color-primary-light: #977a2f;
|
|
27
|
-
--ifm-color-primary-lighter: #c29c3c;
|
|
28
|
-
--ifm-color-primary-lightest: #dcab30;
|
|
29
|
-
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.hero {
|
|
33
|
-
background-image: url("/static/img/hero.png");
|
|
34
|
-
background-size: cover;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/* NODE ATTRIBUTES */
|
|
38
|
-
.attribs
|
|
39
|
-
{
|
|
40
|
-
display:block;
|
|
41
|
-
width: 100%;
|
|
42
|
-
}
|
|
43
|
-
.attribs-header {
|
|
44
|
-
font-weight: bold;
|
|
45
|
-
background-color: rgba(128,128,128, 0.3);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.attribs-block {
|
|
49
|
-
display:flex;
|
|
50
|
-
flex-direction:column;
|
|
51
|
-
width: 100%;
|
|
52
|
-
margin-top: 6px;
|
|
53
|
-
border-style: solid;
|
|
54
|
-
border-color: rgb(128,128,128,0.4);
|
|
55
|
-
border-width: 1px;
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
.attribs-body {
|
|
59
|
-
background-color: rgba(128,128,128, 0.1);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.attribs-row {
|
|
63
|
-
display:flex;
|
|
64
|
-
flex-direction:row;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.attribs-row > .attribs-name {flex-basis: 40%;}
|
|
68
|
-
.attribs-row > .attribs-type {flex-basis: 30%;}
|
|
69
|
-
.attribs-row > .attribs-default {flex-basis: 20%;}
|
|
70
|
-
.attribs-row > .attribs-flags {flex-basis: 10%; }
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.attribs-cell {
|
|
74
|
-
border-style: solid;
|
|
75
|
-
border-color: rgb(128,128,128,0.4);
|
|
76
|
-
border-width: 1px;
|
|
77
|
-
padding-left: 4px;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.attribs-flags {
|
|
81
|
-
display:flex;
|
|
82
|
-
flex-direction:row;
|
|
83
|
-
justify-content: space-around;
|
|
84
|
-
letter-spacing: 0.1em;
|
|
85
|
-
font-weight:bold;
|
|
86
|
-
}
|
|
87
|
-
.attribs-desc {
|
|
88
|
-
display:block;
|
|
89
|
-
padding-left: 4px;
|
|
90
|
-
font-size: 0.9em;
|
|
91
|
-
/* line-height: 1.2em; */
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
/* COMMAND OPTIONS */
|
|
97
|
-
.opts
|
|
98
|
-
{
|
|
99
|
-
display:block;
|
|
100
|
-
width: 100%;
|
|
101
|
-
}
|
|
102
|
-
.opts-header {
|
|
103
|
-
font-weight: bold;
|
|
104
|
-
background-color: rgba(128,128,128, 0.3);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.opts-block {
|
|
108
|
-
display:flex;
|
|
109
|
-
flex-direction:column;
|
|
110
|
-
width: 100%;
|
|
111
|
-
margin-top: 6px;
|
|
112
|
-
border-style: solid;
|
|
113
|
-
border-color: rgb(128,128,128,0.4);
|
|
114
|
-
border-width: 1px;
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
.opts-body {
|
|
118
|
-
background-color: rgba(128,128,128, 0.1);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
.opts-row {
|
|
122
|
-
display:flex;
|
|
123
|
-
flex-direction:row;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.opts-row > .opts-name {flex-basis: 50%;}
|
|
127
|
-
.opts-row > .opts-type {flex-basis: 35%;}
|
|
128
|
-
.opts-row > .opts-properties {flex-basis: 15%;}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
.opts-cell {
|
|
133
|
-
border-style: solid;
|
|
134
|
-
border-color: rgb(128,128,128,0.4);
|
|
135
|
-
border-width: 1px;
|
|
136
|
-
padding-left: 4px;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.opts-flags {
|
|
140
|
-
display:flex;
|
|
141
|
-
flex-direction:row;
|
|
142
|
-
justify-content: space-around;
|
|
143
|
-
letter-spacing: 0.1em;
|
|
144
|
-
font-weight:bold;
|
|
145
|
-
}
|
|
146
|
-
.opts-desc {
|
|
147
|
-
display:block;
|
|
148
|
-
padding-left: 4px;
|
|
149
|
-
font-size: 0.9em;
|
|
150
|
-
/* line-height: 1.2em; */
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.opts-properties > span
|
|
154
|
-
{
|
|
155
|
-
margin-right:8px;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
.opts-prop-create {
|
|
159
|
-
color: #36be00
|
|
160
|
-
}
|
|
161
|
-
/* .opts-prop-query {
|
|
162
|
-
color: #af00db
|
|
163
|
-
} */
|
|
164
|
-
.opts-prop-edit {
|
|
165
|
-
color: #007dd1
|
|
166
|
-
}
|
|
167
|
-
.opts-prop-multiuse {
|
|
168
|
-
color: #d45800
|
|
169
|
-
}
|
|
170
|
-
|
ciocore/package_query.py
DELETED
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Generate markdown from the software packages list.
|
|
3
|
-
"""
|
|
4
|
-
import os
|
|
5
|
-
import sys
|
|
6
|
-
import json
|
|
7
|
-
from ciocore.package_tree import PackageTree
|
|
8
|
-
from ciocore import api_client
|
|
9
|
-
import markdown
|
|
10
|
-
import io
|
|
11
|
-
import tempfile
|
|
12
|
-
import webbrowser
|
|
13
|
-
|
|
14
|
-
PURE = """
|
|
15
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/purecss@3.0.0/build/pure-min.css" integrity="sha384-X38yfunGUhNzHpBaEBsWLO+A0HDYOQi8ufWDkZ0k9e0eXz/tH3II7uKZ9msv++Ls" crossorigin="anonymous">
|
|
16
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
def green(rhs):
|
|
20
|
-
return "\033[92m{}\033[0m".format(rhs)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
def red(rhs):
|
|
24
|
-
return "\033[91m{}\033[0m".format(rhs)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def blue(rhs):
|
|
28
|
-
return "\033[94m{}\033[0m".format(rhs)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def magenta(rhs):
|
|
32
|
-
return "\033[95m{}\033[0m".format(rhs)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def raw(rhs, stream):
|
|
36
|
-
stream.write("{}\n\n".format(rhs))
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def d(n, rhs, stream):
|
|
40
|
-
"""Indent with dashes"""
|
|
41
|
-
stream.write("{} {}\n".format("-" * n, rhs))
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def hr(stream):
|
|
45
|
-
stream.write("---\n\n")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def h(n, rhs, stream):
|
|
49
|
-
stream.write("{} {}\n\n".format("#" * n, rhs))
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def plugin_table_header(stream):
|
|
53
|
-
stream.write(
|
|
54
|
-
'|<div style="width:150px">Plugin</div> |<div style="min-width:400px">Versions</div>|\n|:------------|:-------------|\n'
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def plugin_table_row(plugin, versions, stream):
|
|
59
|
-
stream.write("|{}|{}|\n".format(plugin, versions))
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
def write_markdown(hostnames, tree_data, platform, stream):
|
|
63
|
-
"""
|
|
64
|
-
Write the tree of packages in Markdown.
|
|
65
|
-
|
|
66
|
-
Use this to generate docs for the Conductor mkdocs site.
|
|
67
|
-
"""
|
|
68
|
-
if not hostnames:
|
|
69
|
-
return
|
|
70
|
-
h(2, "{} Software".format(platform.capitalize()), stream)
|
|
71
|
-
last_hostgroup = None
|
|
72
|
-
for hostname in hostnames:
|
|
73
|
-
display_hostname = " ".join(hostname.split()[:2])
|
|
74
|
-
hostgroup = hostname.split(" ")[0]
|
|
75
|
-
stream.write("\n")
|
|
76
|
-
if not hostgroup == last_hostgroup:
|
|
77
|
-
hr(stream)
|
|
78
|
-
h(3, hostgroup, stream)
|
|
79
|
-
h(4, display_hostname, stream)
|
|
80
|
-
last_hostgroup = hostgroup
|
|
81
|
-
plugins = tree_data.supported_plugins(hostname)
|
|
82
|
-
if plugins:
|
|
83
|
-
plugin_table_header(stream)
|
|
84
|
-
for plugin in plugins:
|
|
85
|
-
plugin_table_row(
|
|
86
|
-
plugin["plugin"], ", ".join(plugin["versions"]), stream
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
def write_text(hostnames, tree_data, platform, color_func, stream):
|
|
91
|
-
"""
|
|
92
|
-
Write the tree of packages as text.
|
|
93
|
-
|
|
94
|
-
Products are indented with one dash.
|
|
95
|
-
Host packages are indented with two dashes.
|
|
96
|
-
Plugin packages are indented with three dashes.
|
|
97
|
-
"""
|
|
98
|
-
if not hostnames:
|
|
99
|
-
d(0, red("There are no '{}' host packages".format(platform)), stream)
|
|
100
|
-
return
|
|
101
|
-
d(0, "{} Software".format(platform).upper(), stream)
|
|
102
|
-
last_hostgroup = None
|
|
103
|
-
for hostname in hostnames:
|
|
104
|
-
display_hostname = " ".join(hostname.split()[:2])
|
|
105
|
-
hostgroup = hostname.split(" ")[0]
|
|
106
|
-
if not hostgroup == last_hostgroup:
|
|
107
|
-
d(0, green("-" * 30), stream)
|
|
108
|
-
d(1, color_func(hostgroup), stream)
|
|
109
|
-
d(2, color_func(display_hostname), stream)
|
|
110
|
-
last_hostgroup = hostgroup
|
|
111
|
-
plugins = tree_data.supported_plugins(hostname)
|
|
112
|
-
if plugins:
|
|
113
|
-
for plugin in plugins:
|
|
114
|
-
d(
|
|
115
|
-
3,
|
|
116
|
-
color_func(
|
|
117
|
-
"{} [{}]".format(
|
|
118
|
-
plugin["plugin"], ", ".join(plugin["versions"])
|
|
119
|
-
)
|
|
120
|
-
),
|
|
121
|
-
stream,
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
def pq(format="text"):
|
|
126
|
-
packages = api_client.request_software_packages()
|
|
127
|
-
|
|
128
|
-
tree_data = PackageTree(packages)
|
|
129
|
-
|
|
130
|
-
hostnames = tree_data.supported_host_names()
|
|
131
|
-
linux_hostnames = [h for h in hostnames if h.endswith("linux")]
|
|
132
|
-
windows_hostnames = [h for h in hostnames if h.endswith("windows")]
|
|
133
|
-
|
|
134
|
-
if format == "markdown":
|
|
135
|
-
stream = sys.stdout
|
|
136
|
-
raw(
|
|
137
|
-
"This page contains the complete list of software available at Conductor. If you require applications or plugins that are not in the list, please [create a support ticket](https://support.conductortech.com/hc/en-us/requests/new) and let us know.",
|
|
138
|
-
stream,
|
|
139
|
-
)
|
|
140
|
-
write_markdown(linux_hostnames, tree_data, "linux", stream)
|
|
141
|
-
write_markdown(windows_hostnames, tree_data, "windows", stream)
|
|
142
|
-
elif format == "text":
|
|
143
|
-
stream = sys.stdout
|
|
144
|
-
write_text(linux_hostnames, tree_data, "linux", magenta, stream)
|
|
145
|
-
d(0, "", stream)
|
|
146
|
-
write_text(windows_hostnames, tree_data, "windows", blue, stream)
|
|
147
|
-
elif format == "html":
|
|
148
|
-
stream = io.StringIO()
|
|
149
|
-
raw(
|
|
150
|
-
"This page contains the complete list of software available at Conductor. If you require applications or plugins that are not in the list, please [create a support ticket](https://support.conductortech.com/hc/en-us/requests/new) and let us know.",
|
|
151
|
-
stream,
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
write_markdown(linux_hostnames, tree_data, "linux", stream)
|
|
155
|
-
write_markdown(windows_hostnames, tree_data, "windows", stream)
|
|
156
|
-
|
|
157
|
-
html = markdown.markdown(
|
|
158
|
-
stream.getvalue(), extensions=["markdown.extensions.tables"]
|
|
159
|
-
)
|
|
160
|
-
|
|
161
|
-
html = decorate(html)
|
|
162
|
-
|
|
163
|
-
stream.close()
|
|
164
|
-
with tempfile.NamedTemporaryFile(mode="w", suffix=".html", delete=False) as f:
|
|
165
|
-
f.write(html)
|
|
166
|
-
webbrowser.open("file://" + f.name, new=2)
|
|
167
|
-
|
|
168
|
-
def decorate(html):
|
|
169
|
-
html = html.replace("<table>", '<table class="pure-table pure-table-bordered">')
|
|
170
|
-
html = '<html><head>{}</head><body style="margin: 2em;">{}</body></html>'.format(PURE, html)
|
|
171
|
-
return html
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
ciocore/VERSION,sha256=GaUW2S1ruj-4dv6usRW-6ybdXm2_P1naokZ3yiaQmqg,10
|
|
2
|
-
ciocore/__about__.py,sha256=w23ToSZc0RpHPxOe-gPr1qA_yFqOFY0WvrujXwGisTk,717
|
|
3
|
-
ciocore/__init__.py,sha256=zB_e7gBW2QloqbrGzcvccfpZhOhd6o9KACnScrwylm8,25
|
|
4
|
-
ciocore/api_client.py,sha256=ITfbNTDnjd7-jrb9OlFB6xYH6AhBU2u0E3eaZcD5Wms,20894
|
|
5
|
-
ciocore/cli.py,sha256=FCkBsS1g_2LSZmca_O4Y0uP3SqAYAW5PbbLjQONQUGg,12341
|
|
6
|
-
ciocore/client_db.py,sha256=tTz3bl2xeDPPcYSDS3g3QgV_xYihJMx0Kj6OeN2klK0,12978
|
|
7
|
-
ciocore/common.py,sha256=FnggAL-IGW8VQB6kLsrKLnxWFgLpwGBhOtiZSHz130M,14725
|
|
8
|
-
ciocore/compat.py,sha256=5uEXPSog_jxsDMaHBswAKEtfyXT25VgU6WNGIhz9PHU,256
|
|
9
|
-
ciocore/conductor_submit.py,sha256=ONE0LsA5hGavTJIOXXYx8qzl8_vBPADwhd6Ytq_0E0c,9382
|
|
10
|
-
ciocore/config.py,sha256=T6TOptTAuYQeuadtSzBl8sayC1lbX5FDXL8djcnV8v8,8138
|
|
11
|
-
ciocore/data.py,sha256=-jsGczfHzlZBMs5J9o5yUgiRO4dmlJJOhTJj3L2mKbA,8675
|
|
12
|
-
ciocore/dev_inst_tagger.py,sha256=bPfoFbE7IPCpDbtbVHxW7IlMwvspdnJhPuNq-u4fJN4,3497
|
|
13
|
-
ciocore/downloader.py,sha256=Q5DCN3I6bvGsVoJir4XisOjlZVTQV41fgJg0H4Obagw,50636
|
|
14
|
-
ciocore/exceptions.py,sha256=4Oq-WX-qiN6kPUdBCHvvd6mtSQ0nCkDbJxWt2CNtpv8,1504
|
|
15
|
-
ciocore/file_utils.py,sha256=bAlL31B4YkRgX-yT8kF8UXBFktQlsE1PvxbKqTeAeOU,17174
|
|
16
|
-
ciocore/hardware_set.py,sha256=2nyb7Sac_nVwvHaeG6zwXHDPeUnxXQPgUO932kyYn6s,14486
|
|
17
|
-
ciocore/loggeria.py,sha256=dKKJC8ZtRZdghqD5R5XrA6eDoy8gKacfeTA-zNzXvDE,13482
|
|
18
|
-
ciocore/package_environment.py,sha256=9lPyZqFPnycDcGKpL8HG2XMxmblrRTK00ze8-peS5mE,7045
|
|
19
|
-
ciocore/package_query.py,sha256=2m5EBXfu1lmqupZrFF8f8mfkX_PgijpdMxCtFI5e5s0,5574
|
|
20
|
-
ciocore/package_tree.py,sha256=vkORKXxQ7dO8l0_96eFwm-5AUVL0rP9bhgWYhW_v3lo,15649
|
|
21
|
-
ciocore/post_install.py,sha256=zu5Ctz2ANbKD-f5G2ODLIhKkWENBi4F3UKKu50OEWrg,1000
|
|
22
|
-
ciocore/validator.py,sha256=f_K7gxz122W_i5AxVx6dKhckOygl8TnmQiVj7tyX5zw,2344
|
|
23
|
-
ciocore/worker.py,sha256=_WQq2_ZhXuc5NTfYQtcWUGULU6IUZykeVW5e_4_ffZc,21728
|
|
24
|
-
ciocore/auth/__init__.py,sha256=cdS-xZzMq41yXM5cz8sUlcYgo8CJYh8HcCCWmhbDgf0,606
|
|
25
|
-
ciocore/auth/server.py,sha256=8btX9-EokUl6q55V8muDmEV2tvvbTBD0BHeWFbwkzUc,3892
|
|
26
|
-
ciocore/docsite/404.html,sha256=bVcbQCbX-H9_8nrAhD9ZyFuzLjA3mBRMrjfyXzZZDz4,17207
|
|
27
|
-
ciocore/docsite/index.html,sha256=xmqx3WmkuEjuTTl17JIjz0js_UO-T_sM6OUFtodrAtQ,20945
|
|
28
|
-
ciocore/docsite/logo.png,sha256=gArgFFWdw8w985-0TkuGIgU_pW9sziEMZdqytXb5WLo,2825
|
|
29
|
-
ciocore/docsite/objects.inv,sha256=zrqT6xv95it5J6sVIvMHw3m73ry8vcWynC-zCaMteiw,705
|
|
30
|
-
ciocore/docsite/sitemap.xml,sha256=M_V85zl0y2adRvzJAnoCxlZH_Hl7TLnIb1A-6l_xGmI,109
|
|
31
|
-
ciocore/docsite/sitemap.xml.gz,sha256=BPI9z6ZwpTi1dyngue4o7F6XDYEXp3fRb-33ZhAUHkU,127
|
|
32
|
-
ciocore/docsite/apidoc/api_client/index.html,sha256=_aBQZ_oDBqVlEOE1Kw8_DJgaq_UZf8tvEap9KYyZ9y0,133437
|
|
33
|
-
ciocore/docsite/apidoc/apidoc/index.html,sha256=pNvaqQFQUXFVbpM7ThXG78CpqiZ1PzsqAysZFGFaxew,26171
|
|
34
|
-
ciocore/docsite/apidoc/config/index.html,sha256=weE7tPmkm-ipf5Ug3ET43hrPJJL8Xno26BFvBOrBhiU,69548
|
|
35
|
-
ciocore/docsite/apidoc/data/index.html,sha256=71qfln1epyqVCtTHNpS1KaCNBaRgIrpH07suOCQ8Wdw,55422
|
|
36
|
-
ciocore/docsite/apidoc/hardware_set/index.html,sha256=0sesU5cJBXOyQLml2uj2Y0q4ewuBZ2Uk4mOxj46607w,118011
|
|
37
|
-
ciocore/docsite/apidoc/package_environment/index.html,sha256=3iE2arQkh3YrnzRcwKlF5aX_IO3PghJa2mW_HlWCAio,65729
|
|
38
|
-
ciocore/docsite/apidoc/package_tree/index.html,sha256=zX1z5eUiHtgkuqjE-7u11YaeEvQ2JQcAWI--VXb1txc,109393
|
|
39
|
-
ciocore/docsite/assets/_mkdocstrings.css,sha256=K3bqYEmxlOHQ3-M11JNbBWHCBDBLarkFRm8HuEYrAG4,341
|
|
40
|
-
ciocore/docsite/assets/images/favicon.png,sha256=AjhUxD_Eslt5XuSVHIAZ494Fk__rb5GLXR8qm0elfP4,1870
|
|
41
|
-
ciocore/docsite/assets/javascripts/bundle.4e31edb1.min.js,sha256=vMxCR_BtNIcbmbPV6j8Z-YDLQ9ckt4RzvGuzCTg034s,97250
|
|
42
|
-
ciocore/docsite/assets/javascripts/bundle.4e31edb1.min.js.map,sha256=8Oyq3j4kjJ2wbHtEGTiDI5Svk1xp2kEnoKKUiYA_geM,890964
|
|
43
|
-
ciocore/docsite/assets/javascripts/lunr/tinyseg.js,sha256=GwRMI5YQ72X87_YDlWdEK7FpLUE_Xuhob-6BsaMGd2E,22878
|
|
44
|
-
ciocore/docsite/assets/javascripts/lunr/wordcut.js,sha256=PTj95orzSJFSiORe6zOK-CVshhH6LP7zB-arlYCLNWc,677463
|
|
45
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.ar.min.js,sha256=iaHcsJSoSR2WjBUaslSgMZXIf_KtqiQIx2mSgoSEcSU,17074
|
|
46
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.da.min.js,sha256=KhJzQEjq504KBeXBCP3yTCtx382NpxIzbKnj0nq5KVY,4654
|
|
47
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.de.min.js,sha256=vKp8XBm8cwwFu5HiKuDjhuGsSgWAxCt9lPm4dXqtras,6119
|
|
48
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.du.min.js,sha256=RS2gT-RJucZcYThP7FgtxjgkvU5Vn64sOSaneQto6XY,6208
|
|
49
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.es.min.js,sha256=3sTskL1vR4yj5lY2qOP-31ErI9AaUaAdfngi9n67qvg,11499
|
|
50
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.fi.min.js,sha256=aBVB_PWxmHrYsAdm6cBjiez5nD166Bf6iR-SP2kbhmg,9342
|
|
51
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.fr.min.js,sha256=TdVqolUedwrSbvS4UJLNMUR2ceDoSzlRQnhUf1QXc3c,10669
|
|
52
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.hi.min.js,sha256=Yx__UuNiPy37o1rwdsa4taRQ7v_jClz6x0WNq3fL4KY,3383
|
|
53
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.hu.min.js,sha256=h2yWm79KK4Rzj04KFJIu4zHLfCGTpiH2Xbf4Nv3TOjg,9437
|
|
54
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.hy.min.js,sha256=DvvLkCvbfsDd3_peK6NHt0xJ_8X0P9c__tg1KOuhLpU,1264
|
|
55
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.it.min.js,sha256=AKUHPfLpIuX97RxaTUARrsAkcqudkYKnxlCNYLYlxFM,11232
|
|
56
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.ja.min.js,sha256=xP3tMI9jNoGm7VO2wQ2MpZFv39UPa4LskU1yW-DLi9Y,2313
|
|
57
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.jp.min.js,sha256=BBFO3DbcEU7c5a-7PH95X0XHfYZzwe3NylZ13atdUZk,36
|
|
58
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.kn.min.js,sha256=oGTQ10ODNJV6RCtiYUD7cvTt6OvhfrXE4laC2HyIu_g,3494
|
|
59
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.ko.min.js,sha256=c9G9sd5K72xZIPUWkkxascRA21Cm9cYSa9D7fPXTdmQ,7972
|
|
60
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.multi.min.js,sha256=l2H0da5582Qg_3FN-ZUO-yZO_8-SMO_VW1EaDeiZ6Xk,817
|
|
61
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.nl.min.js,sha256=OZ7ybWHtLVgG9Y6nI9-soJ9KfJtR4xW90XSCyOMBOj4,6026
|
|
62
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.no.min.js,sha256=V_nbkpD57TYIB1X1PuNCoE9VpZVOSt2RXRwwGjdGRXM,4754
|
|
63
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.pt.min.js,sha256=OiXSq6ojBjzxP8VsGa5MxQUMtiFRFenQj0pvS3h4AGc,10171
|
|
64
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.ro.min.js,sha256=z6JqjqQpPYHoVHuiMh1wOg_piB8HIfyl8zo_gL8Vbuk,10958
|
|
65
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.ru.min.js,sha256=UO88D6tKPy0mDolzxjNjqg3PArVZ6p0R1fArYZdYXBc,10331
|
|
66
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.sa.min.js,sha256=QcVYpDVcPq6PCieuhwcSc48UsL2IA4BCrIq4tBHlgX8,4901
|
|
67
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.stemmer.support.min.js,sha256=LnITYFhGoYAU7HUJEMsYqKTGC7IyABA7P62e8nsQxwU,3647
|
|
68
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.sv.min.js,sha256=lCsWW8yCGOMkb8RzWvmxwvZlFDZtAAC-BRvxu4ltQT4,4523
|
|
69
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.ta.min.js,sha256=F6MtxJwnydJ5RWJafo0GbUL2TqHOWls03kJ3I_v5rio,2406
|
|
70
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.te.min.js,sha256=B5yPzwKK7vOI6Y7IYHyOpQupZgxGeXyKEZ0F-PggWDg,2330
|
|
71
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.th.min.js,sha256=NIRhJmhD4xayaCAASpbT_YehV5gp0kTOUQwXKT7vBDk,1031
|
|
72
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.tr.min.js,sha256=6L9XsQM7i9kuoEqUxTMBWqGn8KjWgwGUuXTpTh5Kyjw,15009
|
|
73
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.vi.min.js,sha256=LjnD_XMF9uZvwEJHlqdpbLjjbcD1w6g-obxE3-P-y1Y,784
|
|
74
|
-
ciocore/docsite/assets/javascripts/lunr/min/lunr.zh.min.js,sha256=2MW3LDbsnDGXYCVG6bpbV62j9yXVZKVRvxbquvtUjog,2158
|
|
75
|
-
ciocore/docsite/assets/javascripts/workers/search.dfff1995.min.js,sha256=dSn8S0AZNSnDklowowFe_v5geq6WOXg3zQiH_JuRUTY,39431
|
|
76
|
-
ciocore/docsite/assets/javascripts/workers/search.dfff1995.min.js.map,sha256=WRu84gT6TJxoh21TdmByytMRPpYv8PHzHKdSvS1psrM,214982
|
|
77
|
-
ciocore/docsite/assets/stylesheets/main.83068744.min.css,sha256=gwaHRErdgDoSsYabs3TkMGBpuUc9kTXNLWwucSPCqZ0,122334
|
|
78
|
-
ciocore/docsite/assets/stylesheets/main.83068744.min.css.map,sha256=q8dWQkgGSfCcYT2Le1J0Tmxpcqxol5kZKaokp9d8Af0,42278
|
|
79
|
-
ciocore/docsite/assets/stylesheets/palette.ecc896b0.min.css,sha256=7MiWsGpIt19TLduugHr1OQv1TJ9rEsndnkc2V8D9VjM,12245
|
|
80
|
-
ciocore/docsite/assets/stylesheets/palette.ecc896b0.min.css.map,sha256=T8ZT8Mw8ws4vxyx_b1QAwyC9_pnv7r0KVaUdu2ST7ug,3639
|
|
81
|
-
ciocore/docsite/cmdline/docs/index.html,sha256=NV_2TPLZsnth0Xqkw1BD33LuEo_rl0qnuMELEcsOMk0,20051
|
|
82
|
-
ciocore/docsite/cmdline/downloader/index.html,sha256=kAZtXFZ8YNy7hYq-S9nLQfAyye7qoQrMZ5y6mHHy78c,23171
|
|
83
|
-
ciocore/docsite/cmdline/packages/index.html,sha256=xa62btTjJK94EMDrZtMplXO5szY48S712lFCeOVVSkI,20923
|
|
84
|
-
ciocore/docsite/cmdline/uploader/index.html,sha256=dJLptY1KI5TWDZpve1JrYv_4DTf7VvFp1TbbkN2rU38,25123
|
|
85
|
-
ciocore/docsite/how-to-guides/index.html,sha256=JZAcUHJ4ZU833JHJkU7cwyxHRUlARgh2mdI4ZQO0HhY,20100
|
|
86
|
-
ciocore/docsite/search/search_index.json,sha256=j6wpEQzR_-80NREoNWzRtDMwxZghhV57ZJZ0TG0P57I,171579
|
|
87
|
-
ciocore/docsite/stylesheets/extra.css,sha256=qgfcao9TEBzf6ieAWN5rPyrea7YM_YgVg5qr4NPrxoU,354
|
|
88
|
-
ciocore/docsite/stylesheets/tables.css,sha256=O2PEwlKC0RfvZCRV9UERqQRvhb6jcqO84PLew0bafF0,3279
|
|
89
|
-
ciocore/uploader/__init__.py,sha256=hxRFJf5Lo86rtRObFXSjjot8nybQd-SebSfYCbgZwow,24
|
|
90
|
-
ciocore/uploader/_uploader.py,sha256=NDtoSgfUkmHCY6h0yypiPrwGH6nJwTORp_LptHCiv28,37675
|
|
91
|
-
ciocore/uploader/upload_stats/__init__.py,sha256=kc1YCXZOy4EBpSSRIJKe89DWgiBwTzOPMbZ7530EXWw,5354
|
|
92
|
-
ciocore/uploader/upload_stats/stats_formats.py,sha256=dtjsxdbT4w6BXFay19dzijf-xLwf6TktNk75Wq3rPAw,2452
|
|
93
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
|
-
tests/instance_type_fixtures.py,sha256=zAulZ452kdhDn6sxWeAY-XwEsQP5drBiUKuVoSjfC_4,4162
|
|
95
|
-
tests/package_fixtures.py,sha256=CsJnhB7oYzIxJH7b1tCOPyvnnVSCqEbSPhtCnsHL-nA,5070
|
|
96
|
-
tests/test_api_client.py,sha256=dWOmAIKmX0gLaDGsT9VfAq9Hcs9HIQf2P5IMM_Bt5dE,1284
|
|
97
|
-
tests/test_cli.py,sha256=Td8kUgIz9GhCG0FxbL66Kohf4tpJRhQnOFE_tZSe-8k,5970
|
|
98
|
-
tests/test_common.py,sha256=lJpzRdL-7u4McXFbLuwPQQoUnuEOnCVQtZEt6e_dIYs,638
|
|
99
|
-
tests/test_config.py,sha256=nSmpinX2SmDNAprIcxs9UHdB0VakJB0snXaZmAoKJSc,12863
|
|
100
|
-
tests/test_data.py,sha256=YdP1kZJivQ6yb9z96UK6oMDaOfJAl4YMJqzKvlCQaes,5744
|
|
101
|
-
tests/test_downloader.py,sha256=Xr6-y3SjfTAo0JM2VDGoSx-nEtRj3BY-Q4JtSNFl3ro,2090
|
|
102
|
-
tests/test_hardware_set.py,sha256=zEenyPdmPSMjN0_j7tAOJ3wqyXLVuHmVOxTAQpV-eMs,4410
|
|
103
|
-
tests/test_imports_2and3.py,sha256=ehqpRYPVY7djBcb8OT_cnh86iCJJ9wuMWnfSR9RHxmY,507
|
|
104
|
-
tests/test_package_environment.py,sha256=CdiC2PDVSnbcwTb4fsDTWqGYSzs1n5ca2KMoyISckGA,5893
|
|
105
|
-
tests/test_package_tree.py,sha256=xCwNwYUmJrfmgCP2FGoHRFG-L0JPy8s4-66icxAls4o,6780
|
|
106
|
-
tests/test_submit.py,sha256=4idfa48IouM4JgfQzBLiZyygtU-jwLdOBtV0AgfBzH0,4834
|
|
107
|
-
tests/test_uploader.py,sha256=B1llTJt_fqR6e_V_Jxfw9z73QgkFlEPU87xLYGzt-TQ,2914
|
|
108
|
-
tests/test_validator.py,sha256=2fY66ayNc08PGyj2vTI-V_1yeCWJDngkj2zkUM5TTCI,1526
|
|
109
|
-
tests/mocks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
110
|
-
tests/mocks/glob.py,sha256=J2MH7nqi6NJOHuGdVWxhfeBd700_Ckj6cLh_8jSNkfg,215
|
|
111
|
-
ciocore-6.3.2rc1.dist-info/METADATA,sha256=fLCazGb-hHhpoNTBpAnInci2WaO_clYfy7ReHhtTk9g,15434
|
|
112
|
-
ciocore-6.3.2rc1.dist-info/WHEEL,sha256=a-zpFRIJzOq5QfuhBzbhiA1eHTzNCJn8OdRvhdNX0Rk,110
|
|
113
|
-
ciocore-6.3.2rc1.dist-info/entry_points.txt,sha256=cCqcALMYbC4d8545V9w0Zysfg9MVuKWhzDQ2er4UfGE,47
|
|
114
|
-
ciocore-6.3.2rc1.dist-info/top_level.txt,sha256=SvlM5JlqULzAz00JZWfiUhfjhqDzYzSWssA87zdJl0o,14
|
|
115
|
-
ciocore-6.3.2rc1.dist-info/RECORD,,
|
tests/test_cli.py
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
from click.testing import CliRunner
|
|
2
|
-
from ciocore.cli import upload as cli_upload
|
|
3
|
-
from ciocore.cli import download as cli_download
|
|
4
|
-
import unittest
|
|
5
|
-
import os
|
|
6
|
-
from unittest import mock
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class CliTestUploaderOptions(unittest.TestCase):
|
|
10
|
-
def setUp(self):
|
|
11
|
-
self.runner = CliRunner()
|
|
12
|
-
self.default_args = {
|
|
13
|
-
"database_filepath": None,
|
|
14
|
-
"location": None,
|
|
15
|
-
"md5_caching": True,
|
|
16
|
-
"log_level": "INFO",
|
|
17
|
-
"log_dir": None,
|
|
18
|
-
"thread_count": 16,
|
|
19
|
-
}
|
|
20
|
-
init_patcher = mock.patch("ciocore.cli.Uploader.__init__", autospec=True)
|
|
21
|
-
self.mock_init = init_patcher.start()
|
|
22
|
-
self.addCleanup(init_patcher.stop)
|
|
23
|
-
|
|
24
|
-
def test_receives_full_args_dict_with_defaults_when_no_args_given(self):
|
|
25
|
-
self.runner.invoke(cli_upload, [])
|
|
26
|
-
self.mock_init.assert_called_once_with(mock.ANY, self.default_args)
|
|
27
|
-
|
|
28
|
-
def test_database_filepath_arg(self):
|
|
29
|
-
self.runner.invoke(cli_upload, ["--database_filepath", "foo"])
|
|
30
|
-
expected = self.default_args
|
|
31
|
-
expected.update({"database_filepath": "foo"})
|
|
32
|
-
self.mock_init.assert_called_once_with(mock.ANY, expected)
|
|
33
|
-
|
|
34
|
-
def test_location_arg(self):
|
|
35
|
-
self.runner.invoke(cli_upload, ["--location", "foo"])
|
|
36
|
-
expected = self.default_args
|
|
37
|
-
expected.update({"location": "foo"})
|
|
38
|
-
self.mock_init.assert_called_once_with(mock.ANY, expected)
|
|
39
|
-
|
|
40
|
-
def test_md5_caching_arg(self):
|
|
41
|
-
self.runner.invoke(cli_upload, ["--md5_caching", False])
|
|
42
|
-
expected = self.default_args
|
|
43
|
-
expected.update({"md5_caching": False})
|
|
44
|
-
self.mock_init.assert_called_once_with(mock.ANY, expected)
|
|
45
|
-
|
|
46
|
-
def test_log_level_arg(self):
|
|
47
|
-
self.runner.invoke(cli_upload, ["--log_level", "DEBUG"])
|
|
48
|
-
expected = self.default_args
|
|
49
|
-
expected.update({"log_level": "DEBUG"})
|
|
50
|
-
self.mock_init.assert_called_once_with(mock.ANY, expected)
|
|
51
|
-
|
|
52
|
-
def test_log_dir_arg(self):
|
|
53
|
-
self.runner.invoke(cli_upload, ["--log_dir", "foo"])
|
|
54
|
-
expected = self.default_args
|
|
55
|
-
expected.update({"log_dir": "foo"})
|
|
56
|
-
self.mock_init.assert_called_once_with(mock.ANY, expected)
|
|
57
|
-
|
|
58
|
-
def test_thread_count_arg(self):
|
|
59
|
-
self.runner.invoke(cli_upload, ["--thread_count", 4])
|
|
60
|
-
expected = self.default_args
|
|
61
|
-
expected.update({"thread_count": 4})
|
|
62
|
-
self.mock_init.assert_called_once_with(mock.ANY, expected)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
class CliTestUploaderArguments(unittest.TestCase):
|
|
66
|
-
def setUp(self):
|
|
67
|
-
self.runner = CliRunner()
|
|
68
|
-
|
|
69
|
-
uploader_patcher = mock.patch("ciocore.cli.Uploader", autospec=True)
|
|
70
|
-
self.mock_uploader = uploader_patcher.start()
|
|
71
|
-
self.mock_inst = self.mock_uploader.return_value
|
|
72
|
-
self.addCleanup(uploader_patcher.stop)
|
|
73
|
-
|
|
74
|
-
def test_path_only_branch_if_paths(self):
|
|
75
|
-
with self.runner.isolated_filesystem():
|
|
76
|
-
filenames = ["foo.txt", "bar.txt", "baz.txt", "qux.txt"]
|
|
77
|
-
filenames = [os.path.join(os.getcwd(), filename) for filename in filenames]
|
|
78
|
-
for filename in filenames:
|
|
79
|
-
with open(filename, "w") as f:
|
|
80
|
-
f.write("hello world")
|
|
81
|
-
self.runner.invoke(cli_upload, filenames)
|
|
82
|
-
self.mock_inst.assets_only.assert_called_once_with(
|
|
83
|
-
mock.ANY, mock.ANY, mock.ANY, mock.ANY
|
|
84
|
-
)
|
|
85
|
-
self.mock_inst.main.assert_not_called()
|
|
86
|
-
|
|
87
|
-
def test_main_branch_if_no_paths(self):
|
|
88
|
-
with self.runner.isolated_filesystem():
|
|
89
|
-
self.runner.invoke(cli_upload)
|
|
90
|
-
self.mock_inst.main.assert_called_once()
|
|
91
|
-
self.mock_inst.assets_only.assert_not_called()
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
class CliTestDownloader(unittest.TestCase):
|
|
95
|
-
def setUp(self):
|
|
96
|
-
self.runner = CliRunner()
|
|
97
|
-
|
|
98
|
-
dljobs_patcher = mock.patch(
|
|
99
|
-
"ciocore.cli.Downloader.download_jobs", autospec=True
|
|
100
|
-
)
|
|
101
|
-
self.mock_dljobs = dljobs_patcher.start()
|
|
102
|
-
self.addCleanup(dljobs_patcher.stop)
|
|
103
|
-
|
|
104
|
-
start_daemon_patcher = mock.patch(
|
|
105
|
-
"ciocore.cli.Downloader.start_daemon", autospec=True
|
|
106
|
-
)
|
|
107
|
-
self.mock_start_daemon = start_daemon_patcher.start()
|
|
108
|
-
self.addCleanup(start_daemon_patcher.stop)
|
|
109
|
-
|
|
110
|
-
def test_jobid_branch_if_job_id(self):
|
|
111
|
-
jid = "00000"
|
|
112
|
-
self.runner.invoke(cli_download, [jid])
|
|
113
|
-
self.mock_dljobs.assert_called_once()
|
|
114
|
-
self.mock_start_daemon.assert_not_called()
|
|
115
|
-
|
|
116
|
-
def test_job_id_only(self):
|
|
117
|
-
jid = "00000"
|
|
118
|
-
self.runner.invoke(cli_download, [jid])
|
|
119
|
-
self.mock_dljobs.assert_called_once_with(
|
|
120
|
-
(jid,), thread_count=mock.ANY, output_dir=mock.ANY
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
def test_several_job_ids(self):
|
|
124
|
-
jid1 = "00000"
|
|
125
|
-
jid2 = "11111"
|
|
126
|
-
self.runner.invoke(cli_download, [jid1, jid2])
|
|
127
|
-
self.mock_dljobs.assert_called_once_with(
|
|
128
|
-
(jid1,jid2), thread_count=mock.ANY, output_dir=mock.ANY
|
|
129
|
-
)
|
|
130
|
-
|
|
131
|
-
def test_job_ids_and_others(self):
|
|
132
|
-
jid1 = "00000"
|
|
133
|
-
jid2 = "11111"
|
|
134
|
-
tc = 4
|
|
135
|
-
od = "foo"
|
|
136
|
-
self.runner.invoke(
|
|
137
|
-
cli_download,
|
|
138
|
-
["--thread_count", tc, "--destination", od, jid1, jid2 ],
|
|
139
|
-
)
|
|
140
|
-
self.mock_dljobs.assert_called_once_with(
|
|
141
|
-
(jid1,jid2), thread_count=tc, output_dir=od
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
def test_daemon_branch_if_no_job_id(self):
|
|
145
|
-
self.runner.invoke(cli_download, [])
|
|
146
|
-
self.mock_start_daemon.assert_called_once()
|
|
147
|
-
self.mock_dljobs.assert_not_called()
|
|
148
|
-
|
|
149
|
-
def test_daemon_branch_args_present(self):
|
|
150
|
-
tc = 4
|
|
151
|
-
od = "foo"
|
|
152
|
-
self.runner.invoke(cli_download)
|
|
153
|
-
self.mock_start_daemon.assert_called_once_with(thread_count=mock.ANY, location=mock.ANY, output_dir=mock.ANY)
|
|
154
|
-
|
|
155
|
-
def test_daemon_branch_args(self):
|
|
156
|
-
tc = 4
|
|
157
|
-
od = "foo"
|
|
158
|
-
loc = "bar"
|
|
159
|
-
self.runner.invoke(cli_download, ["--thread_count", tc, "--destination", od, "--location", loc])
|
|
160
|
-
self.mock_start_daemon.assert_called_once_with(thread_count=tc, location="bar", output_dir=od)
|
|
161
|
-
|
tests/test_downloader.py
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
from ciocore.downloader import Downloader
|
|
3
|
-
import unittest
|
|
4
|
-
from unittest import mock
|
|
5
|
-
|
|
6
|
-
class TestDownloaderFlatten(unittest.TestCase):
|
|
7
|
-
|
|
8
|
-
def test_flatten_single_job_id(self):
|
|
9
|
-
input = ("01234",)
|
|
10
|
-
result = Downloader._flatten(input)
|
|
11
|
-
self.assertEqual(result, [{"job_id": "01234", "tasks":None}])
|
|
12
|
-
|
|
13
|
-
def test_flatten_pad_job_id(self):
|
|
14
|
-
input = ("1234",)
|
|
15
|
-
result = Downloader._flatten(input)
|
|
16
|
-
self.assertEqual(result, [{"job_id": "01234", "tasks":None}])
|
|
17
|
-
|
|
18
|
-
def test_several_job_ids(self):
|
|
19
|
-
input = ("1234","1235","1236")
|
|
20
|
-
result = Downloader._flatten(input)
|
|
21
|
-
self.assertEqual(result, [
|
|
22
|
-
{"job_id": "01234", "tasks":None},
|
|
23
|
-
{"job_id": "01235", "tasks":None},
|
|
24
|
-
{"job_id": "01236", "tasks":None}
|
|
25
|
-
])
|
|
26
|
-
|
|
27
|
-
def test_job_and_tasks(self):
|
|
28
|
-
input = ("1234:1-7x2,10",)
|
|
29
|
-
result = Downloader._flatten(input)
|
|
30
|
-
self.assertEqual(result, [{"job_id": "01234", "tasks":["001","003","005","007","010"]}])
|
|
31
|
-
|
|
32
|
-
def test_several_job_and_tasks(self):
|
|
33
|
-
input = ("1234:1-7x2,10","1235:12-15")
|
|
34
|
-
result = Downloader._flatten(input)
|
|
35
|
-
self.assertEqual(result, [
|
|
36
|
-
{"job_id": "01234", "tasks":["001","003","005","007","010"]},
|
|
37
|
-
{"job_id": "01235", "tasks":["012","013","014","015"]}
|
|
38
|
-
])
|
|
39
|
-
|
|
40
|
-
def test_mix_job_and_job_with_tasks(self):
|
|
41
|
-
input = ("1234","1235:12-15")
|
|
42
|
-
result = Downloader._flatten(input)
|
|
43
|
-
self.assertEqual(result, [
|
|
44
|
-
{"job_id": "01234", "tasks":None},
|
|
45
|
-
{"job_id": "01235", "tasks":["012","013","014","015"]}
|
|
46
|
-
])
|
|
47
|
-
|
|
48
|
-
def test_invalid_range_downloads_whole_job(self):
|
|
49
|
-
# Someone might have a bunch of stuff queued up and made a mistake and left for the night.
|
|
50
|
-
# We should download the whole job in this case so they don't have to restart the dl in the
|
|
51
|
-
# morning.
|
|
52
|
-
input = ("1234:badrange",)
|
|
53
|
-
result = Downloader._flatten(input)
|
|
54
|
-
self.assertEqual(result, [
|
|
55
|
-
{"job_id": "01234", "tasks":None}
|
|
56
|
-
])
|
|
File without changes
|