Skip to content
Snippets Groups Projects
Commit 8eba8172 authored by Amandine  PERRIN's avatar Amandine PERRIN
Browse files

warning if no species name nor output directory given

parent e5d5ed50
No related branches found
No related tags found
No related merge requests found
......@@ -476,8 +476,9 @@ def check_args(parser, args):
# WARNINGS
# User did not specify a species name
if not args.NCBI_species:
print(colored("WARNING: you did not provide a species name ('-s species' option'). "
if not args.NCBI_species and not args.outdir:
print(colored("WARNING: you did not provide a species name ('-s species' option') "
"nor an output directory ('-o outdir'). "
"All files will be downloaded in a folder called with the NCBI species "
f"taxid {args.NCBI_species_taxid} instead of the species name.", "yellow"))
# If user wants to cut genomes, warn him to check that it is on purpose (because default is cut at each 5'N')
......
......@@ -336,13 +336,14 @@ def test_parser_nospecies(capsys):
"""
parser = argparse.ArgumentParser(description="Prepare", add_help=False)
prepare.build_parser(parser)
options = prepare.parse(parser, "-t 1234 -o outdir".split())
options = prepare.parse(parser, "-t 1234".split())
assert not options.no_refseq
assert not options.only_mash
assert options.NCBI_species_taxid == "1234"
assert options.NCBI_species == ""
out, err = capsys.readouterr()
assert ("WARNING: you did not provide a species name ('-s species' option'). "
assert ("WARNING: you did not provide a species name ('-s species' option') "
"nor an output directory ('-o outdir'). "
"All files will be downloaded in a folder called with the NCBI species "
"taxid 1234 instead of the species name.") in out
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment