Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
urmi-21 committed Jan 17, 2021
1 parent f7f3f91 commit 5c767a2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ script:
#- travis_wait 60 coverage run -m pytest tests/
- rm -rf tests/testout
- coverage run -m pytest tests/
#copy config file
- cp tests/test_files/pyrpipe_conf.yaml .
- coverage run -m pytest tests/
- coverage report --show-missing -i
after_success:
- coveralls
2 changes: 1 addition & 1 deletion pyrpipe/pyrpipe_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def get_shell_output(cmd,verbose=None,shell=False):
stderr=''
return(result.returncode,stdout,stderr)
except:
return(-1,"","Command failed to execute")
return(-1,"Command failed to execute","Command failed to execute")

@dryable
def get_return_status(cmd):
Expand Down
17 changes: 12 additions & 5 deletions pyrpipe/runnable.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,16 @@ def get_valid_parameters(self,subcommand):
Returns the list of valid options for the subcommand.
"""
if subcommand:
return self._valid_args[subcommand]
return self._valid_args
pass

if isinstance(self._valid_args, list): return self._valid_args
#if dict
if isinstance(self._valid_args, dict):
if subcommand:
return self._valid_args[subcommand]
#default
return self._valid_args[0]
#no valid format provided
return None

def run(self,*args, subcommand=None, target=None, requires=None, objectid=None, verbose=None,logs=None,**kwargs):
"""
Expand Down Expand Up @@ -564,7 +570,8 @@ def run(self,*args, subcommand=None, target=None, requires=None, objectid=None,
#add to command
cmd.extend(subcommand)


#get valid args
#self.get_valid_parameters(subcommand)
#parse and add parameters
if self._args_style=='LINUX':
cmd.extend(pu.parse_unix_args(self._valid_args,kwargs))
Expand Down
3 changes: 2 additions & 1 deletion tests/test_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@

#create configuration
f=open('pyrpipe_conf.yaml','w')
f.write('dry: true')
f.write('dry: true\n')
f.write('threads: true\n')
f.close()


Expand Down

0 comments on commit 5c767a2

Please sign in to comment.