From 270aac9bd5670d95e5acdda9aca16b71f4e8cae8 Mon Sep 17 00:00:00 2001 From: jimboid Date: Mon, 5 Jun 2017 16:07:58 +0100 Subject: [PATCH] Issue #46 Some more capitals have been removed from the code and tests. There still remains some in the tests, however these cannot be removed until the next Longbow release is out and the example files on hecbiosim.ac.uk are updated. --- longbow/corelibs/entrypoints.py | 13 +++++++------ .../corelibs_entrypoints/test_downloadexamples.py | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/longbow/corelibs/entrypoints.py b/longbow/corelibs/entrypoints.py index b124292..ee89646 100644 --- a/longbow/corelibs/entrypoints.py +++ b/longbow/corelibs/entrypoints.py @@ -496,7 +496,7 @@ def _downloadexamples(longbowargs): # Check if the examples have already been downloaded first. if not os.path.isfile( - os.path.join(os.getcwd(), "LongbowExamples.zip")): + os.path.join(os.getcwd(), "longbow-examples.zip")): print("Downloading examples...") @@ -505,24 +505,25 @@ def _downloadexamples(longbowargs): subprocess.check_call([ "wget", "http://www.hecbiosim.ac.uk/downloads/send/" "2-software/4-longbow-examples", "-O", - os.path.join(os.getcwd(), "LongbowExamples.zip")]) + os.path.join(os.getcwd(), "longbow-examples.zip")]) except subprocess.CalledProcessError: subprocess.call([ "curl", "-L", "http://www.hecbiosim.ac.uk/downloads/send/" "2-software/4-longbow-examples", "-o", - os.path.join(os.getcwd(), "LongbowExamples.zip")]) + os.path.join(os.getcwd(), "longbow-examples.zip")]) # Unzip the archive file. print("Extracting the archive file...") - subprocess.call(["unzip", "-d", os.getcwd(), - os.path.join(os.getcwd(), "LongbowExamples.zip")]) + subprocess.call( + ["unzip", "-d", os.getcwd(), + os.path.join(os.getcwd(), "longbow-examples.zip")]) print("Removing the zip archive file...") - os.remove(os.path.join(os.getcwd(), "LongbowExamples.zip")) + os.remove(os.path.join(os.getcwd(), "longbow-examples.zip")) print("Done.") diff --git a/tests/unit/corelibs_entrypoints/test_downloadexamples.py b/tests/unit/corelibs_entrypoints/test_downloadexamples.py index efb7e25..39a4548 100644 --- a/tests/unit/corelibs_entrypoints/test_downloadexamples.py +++ b/tests/unit/corelibs_entrypoints/test_downloadexamples.py @@ -52,7 +52,8 @@ def test_downloadexamples_wget(): _downloadexamples(longbowargs) - assert not os.path.isfile(os.path.join(os.getcwd(), "LongbowExamples.zip")) + assert not os.path.isfile( + os.path.join(os.getcwd(), "longbow-examples.zip")) assert os.path.isdir(os.path.join(os.getcwd(), "LongbowExamples/")) if os.path.isdir(os.path.join(os.getcwd(), "LongbowExamples/")): @@ -75,7 +76,8 @@ def test_downloadexamples_curl(mock_check_call): _downloadexamples(longbowargs) - assert not os.path.isfile(os.path.join(os.getcwd(), "LongbowExamples.zip")) + assert not os.path.isfile( + os.path.join(os.getcwd(), "longbow-examples.zip")) assert os.path.isdir(os.path.join(os.getcwd(), "LongbowExamples/")) if os.path.isdir(os.path.join(os.getcwd(), "LongbowExamples/")):