Skip to content

Commit bdf634c

Browse files
committed
testing adding pylint, and calling tests properly
1 parent 7ec103c commit bdf634c

File tree

6 files changed

+12
-90
lines changed

6 files changed

+12
-90
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ install:
1818
# - cd $TRAVIS_BUILD_DIR/libexec/python && pylint $PWD --errors-only --ignore tests --disable=E0401,E0611
1919

2020
script:
21-
- cd $TRAVIS_BUILD_DIR && python -m unittest singularity/testing/test_build.py
22-
- cd $TRAVIS_BUILD_DIR && python -m unittest singularity/testing/test_package.py
21+
- cd $TRAVIS_BUILD_DIR/singularity && python -m unittest testing.test_build.py
22+
- cd $TRAVIS_BUILD_DIR/singularity && python -m unittest testing.test_package.py
23+
- cd $TRAVIS_BUILD_DIR/singularity && pylint $PWD --errors-only --ignore tests --disable=E0401,E0611

singularity/api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def api_get(url,headers=None,token=None,data=None):
7373
:param headers: a dictionary with headers for the request
7474
:param putdata: additional data to add to the request
7575
'''
76-
bot.logger.debug("GET ",url)
76+
bot.logger.debug("GET %s",url)
7777

7878
if headers == None:
7979
headers = get_headers(token=token)
@@ -94,7 +94,7 @@ def api_put(url,headers=None,token=None,data=None):
9494
:param headers: a dictionary with headers for the request
9595
:param data: additional data to add to the request
9696
'''
97-
bot.logger.debug("PUT ",url)
97+
bot.logger.debug("PUT %s",url)
9898

9999
if headers == None:
100100
headers = get_headers(token=token)
@@ -115,7 +115,7 @@ def api_post(url,headers=None,data=None,token=None):
115115
:param headers: a dictionary with headers for the request
116116
:param data: additional data to add to the request
117117
'''
118-
bot.logger.debug("POST ",url)
118+
bot.logger.debug("POST %s",url)
119119

120120
if headers == None:
121121
headers = get_headers(token=token)

singularity/runscript.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,9 @@ def get_runscript_parameters(runscript,name,version,description=None):
8585

8686
if language == 'python':
8787
params = get_parameters_python(runscript)
88+
# TODO: here we would write something like boutiqes spec
8889

89-
# Finally, make a boutiques json object with the parameters
90-
if params != None:
91-
json_spec = get_boutiques_json(name=name,
92-
version=version,
93-
inputs=params,
94-
command=name,
95-
description=description)
96-
97-
return json_spec
90+
return params
9891

9992

10093
def get_parameters_python(runscript):

singularity/testing/test_views.py

Lines changed: 0 additions & 72 deletions
This file was deleted.

singularity/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@ def read_file(filename,mode="r"):
231231
def remove_unicode_dict(input_dict):
232232
'''remove unicode keys and values from dict, encoding in utf8
233233
'''
234-
if isinstance(input_dict, basestring):
235-
return str(input_dict)
236-
elif isinstance(input_dict, collections.Mapping):
234+
#if isinstance(input_dict, basestring):
235+
# return str(input_dict)
236+
if isinstance(input_dict, collections.Mapping):
237237
return dict(map(remove_unicode_dict, input_dict.iteritems()))
238238
elif isinstance(input_dict, collections.Iterable):
239239
return type(input_dict)(map(remove_unicode_dict, input_dict))

singularity/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ def make_container_tree(folders,files,path_delim="/",parse_files=True):
204204

205205
# Now make the graph, we simply append children to their parents
206206
seen = []
207+
graph = []
207208
iters = list(range(max_depth+1)) # 0,1,2,3...
208209
iters.reverse() # ...3,2,1,0
209210
iters.pop() # remove 0
@@ -219,7 +220,6 @@ def make_container_tree(folders,files,path_delim="/",parse_files=True):
219220
nodes[parent_id]["children"].append(child_node)
220221

221222
# Now add the parents to graph, with name as main lookup
222-
graph = []
223223
for parent,parent_info in nodes.items():
224224
graph.append(parent_info)
225225
graph = {"name":"base","children":graph}

0 commit comments

Comments
 (0)