Skip to content
Snippets Groups Projects
Verified Commit e6951bda authored by Timm Fitschen's avatar Timm Fitschen
Browse files

removed all table_bottomline stuff. added tests for xls_from_csv

parent c53fc452
Branches
Tags
No related merge requests found
...@@ -67,8 +67,9 @@ test: print-version easy-units ...@@ -67,8 +67,9 @@ test: print-version easy-units
MAVEN_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Dcaosdb.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=0.0.0.0:9000" MAVEN_DEBUG_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE -Dcaosdb.debug=true -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=0.0.0.0:9000"
mvn test -X mvn test -X
PYTEST ?= pytest-3
test_misc: test_misc:
cd scripting/tests/ && pytest-3 test*.py $(PYTEST) scripting/tests/
cd misc/bend_symlinks/ && ./bend_symlinks.sh -h && test/test_suite.sh | tee test_output cd misc/bend_symlinks/ && ./bend_symlinks.sh -h && test/test_suite.sh | tee test_output
cat misc/bend_symlinks/test_output | grep "Ran 10 tests." cat misc/bend_symlinks/test_output | grep "Ran 10 tests."
cat misc/bend_symlinks/test_output | grep "OK" cat misc/bend_symlinks/test_output | grep "OK"
......
...@@ -83,7 +83,7 @@ out : str ...@@ -83,7 +83,7 @@ out : str
return filename return filename
def _parse_arguments(): def _parse_arguments(args):
"""Parses the command line arguments. """Parses the command line arguments.
Takes into account defaults from the environment (where known). Takes into account defaults from the environment (where known).
...@@ -96,11 +96,11 @@ def _parse_arguments(): ...@@ -96,11 +96,11 @@ def _parse_arguments():
help=("An authentication token (not needed, only for " help=("An authentication token (not needed, only for "
"compatibility).")) "compatibility)."))
parser.add_argument('tsv', help="The tsv file.") parser.add_argument('tsv', help="The tsv file.")
return parser.parse_args() return parser.parse_args(args)
def main(): def main():
args = _parse_arguments() args = _parse_arguments(sys.argv[1:])
dataframe = _parse_to_dataframe(args.tsv) dataframe = _parse_to_dataframe(args.tsv)
filename = _write_xls(dataframe, directory=args.tempdir) filename = _write_xls(dataframe, directory=args.tempdir)
print(filename) print(filename)
......
import os
import xls_from_csv
def test_args_parser():
os.environ["SHARED_DIR"] = "test_shared_dir"
args = xls_from_csv._parse_arguments(["test.tsv"])
assert args.tsv == "test.tsv"
../../bin/xls_from_csv.py
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment