From 27aca90b66c13498596414ae0ffdcd4cdeb7f9b9 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 25 Aug 2023 16:33:23 +0100 Subject: [PATCH] test: update rootdir testdata discovery --- tests/test_conflation.py | 4 ++-- tests/test_convert.py | 6 +++--- tests/test_csv.py | 4 ++-- tests/test_osm.py | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/test_conflation.py b/tests/test_conflation.py index 8807e5b7..7aee59e8 100755 --- a/tests/test_conflation.py +++ b/tests/test_conflation.py @@ -28,8 +28,8 @@ rootdir = os.path.basename(os.getcwd()) if rootdir == 'tests': rootdir = "." -elif rootdir == 'main': - rootdir = os.getcwd() + "/tests" +else: + rootdir = rootdir + "/tests" parser = argparse.ArgumentParser(description="Test odk_merge") parser.add_argument("--odk", default=f"{rootdir}/testdata/odk_pois.osm", help="The ODK file") diff --git a/tests/test_convert.py b/tests/test_convert.py index 044f03a3..2bbd7673 100755 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -28,13 +28,13 @@ rootdir = os.path.basename(os.getcwd()) if rootdir == 'tests': rootdir = "." -elif rootdir == 'main': - rootdir = os.getcwd() + "/tests" +else: + rootdir = rootdir + "/tests" parser = argparse.ArgumentParser( description="Read and convert a JSON file from ODK Central" ) -parser.add_argument("--infile", default=f"{rootdir}testdata/testcamps.json", help="The JSON input file") +parser.add_argument("--infile", default=f"{rootdir}/testdata/testcamps.json", help="The JSON input file") args = parser.parse_args() path = xlsforms_path.replace("/xlsforms", "") diff --git a/tests/test_csv.py b/tests/test_csv.py index e673a285..84fde061 100755 --- a/tests/test_csv.py +++ b/tests/test_csv.py @@ -26,8 +26,8 @@ rootdir = os.path.basename(os.getcwd()) if rootdir == 'tests': rootdir = "." -elif rootdir == 'main': - rootdir = os.getcwd() + "/tests" +else: + rootdir = rootdir + "/tests" parser = argparse.ArgumentParser( description="Read and parse a CSV file from ODK Central" diff --git a/tests/test_osm.py b/tests/test_osm.py index 1dc1edf9..55bbe9d9 100755 --- a/tests/test_osm.py +++ b/tests/test_osm.py @@ -27,8 +27,8 @@ rootdir = os.path.basename(os.getcwd()) if rootdir == 'tests': rootdir = "." -elif rootdir == 'main': - rootdir = os.getcwd() + "/tests" +else: + rootdir = rootdir + "/tests" parser = argparse.ArgumentParser( description="Read and parse a CSV file from ODK Central"