From d38b46e5098fe0860d7c96e5701ee8baee317cae Mon Sep 17 00:00:00 2001 From: Matthew Archer Date: Fri, 18 Oct 2024 10:21:57 +0000 Subject: [PATCH] Add docstrings --- tests/python/integration/test_partitioning.py | 16 ++++++++-------- tests/python/test_context.py | 3 +++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/python/integration/test_partitioning.py b/tests/python/integration/test_partitioning.py index 0c176697..3c12a62b 100644 --- a/tests/python/integration/test_partitioning.py +++ b/tests/python/integration/test_partitioning.py @@ -11,10 +11,10 @@ @pytest.fixture(scope="module") def get_data(): - ''' + """ Obtain sample test data using a fixture Function currently unused. - ''' + """ from zipfile import ZipFile urllib.urlopen('ftp://ftp.fluxdata.org/.ameriflux_downloads/.test/US-ARc_sample_output.zip') urllib.urlopen('ftp://ftp.fluxdata.org/.ameriflux_downloads/.test/US-ARc_sample_input.zip') @@ -27,9 +27,9 @@ def get_data(): zo.extractall(path='tests/data/test_reference') def equal_csv(csv_1, csv_2): - ''' + """ Check equality of two csv files. - ''' + """ _log.info("Check csv equality") start = time.time() with open(csv_1, 'r') as t1, open(csv_2, 'r') as t2: @@ -46,13 +46,13 @@ def equal_csv(csv_1, csv_2): @pytest.fixture def setup_data(): - ''' + """ Set up input data for run_partition_nt test. Create data directory for tests './tests/integration/step10' and copy data from expected output ('./datadir/test_output/US-ARc_sample_output') to this directory. - ''' + """ try: os.mkdir('tests/integration/data/step_10') os.mkdir('tests/data/test_reference') @@ -75,9 +75,9 @@ def setup_data(): def test_run_partition_nt(setup_data): - ''' + """ Run partition_nt on single percentile. - ''' + """ datadir = "./tests/python/integration/input/step_10/" refoutdir = "./tests/data/test_reference/" siteid = "US-ARc" diff --git a/tests/python/test_context.py b/tests/python/test_context.py index 9104458a..1fa60871 100644 --- a/tests/python/test_context.py +++ b/tests/python/test_context.py @@ -10,6 +10,9 @@ ''' def test_import_oneflux(): + """ + Test import by checking imported 'oneflux' module has '__version__' attribute + """ import oneflux assert hasattr(oneflux, "__version__")