Skip to content

Commit

Permalink
updated argparsing test for when fasta file is in cwd and args.output…
Browse files Browse the repository at this point in the history
…_path is set to None
  • Loading branch information
JLSteenwyk committed Jul 26, 2022
1 parent cf193fc commit fe56f73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion orthosnap/args_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def process_args(args) -> dict:
output_path = output_path + "/"
else:
output_path = re.sub("/[^/]+$", '', fasta)
if not output_path:
if output_path == fasta:
output_path = "./"
elif not output_path.endswith("/"):
output_path = output_path + "/"
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_args_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,9 @@ def test_output_path_no_slash(self, args):
args.output_path = "./tests/samples"
res = process_args(args)
assert res["output_path"] == "./tests/samples/"

def test_output_path_none(self, args):
args.fasta = "requirements.txt" # fake stand in file
args.output_path = None
res = process_args(args)
assert res["output_path"] == "./"

0 comments on commit fe56f73

Please sign in to comment.