From 72a56b0e1207068b6404d057cc5132ee2a4e2982 Mon Sep 17 00:00:00 2001 From: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> Date: Mon, 18 Jul 2022 13:54:39 -0400 Subject: [PATCH] fix empty string --- tests/test_internals/test_tools.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/test_internals/test_tools.py b/tests/test_internals/test_tools.py index 1198c5d85..72387eb7c 100644 --- a/tests/test_internals/test_tools.py +++ b/tests/test_internals/test_tools.py @@ -32,10 +32,8 @@ LOGGED_INTO_GLOBUS = False except ModuleNotFoundError: HAVE_GLOBUS, LOGGED_INTO_GLOBUS = False, False - -print("here - 1") -print(os.environ) -HAVE_DANDI_KEY = os.getenv("DANDI_API_KEY") is not None # "DANDI_API_KEY" in os.environ +DANDI_API_KEY = os.getenv("DANDI_API_KEY") +HAVE_DANDI_KEY = DANDI_API_KEY is not None and DANDI_API_KEY != "" # can be "" from external forks class TestConversionTools(TestCase): @@ -176,6 +174,10 @@ def test_estimate_total_conversion_runtime(): ] +@pytest.mark.skipif( + not HAVE_DANDI_KEY, + reason="You must set your DANDI_API_KEY to run this test!", +) class TestAutomaticDANDIUpload(TestCase): def setUp(self): self.tmpdir = Path(mkdtemp()) @@ -190,16 +192,14 @@ def setUp(self): def tearDown(self): rmtree(self.tmpdir) - @unittest.skipIf( - not HAVE_DANDI_KEY, - reason="You must set your DANDI_API_KEY to run this test!", - ) def test_automatic_dandi_upload(self): - print("here - 2") - print(os.environ) automatic_dandi_upload(dandiset_id="200560", nwb_folder_path=self.nwb_folder_path, staging=True) +@pytest.mark.skipif( + not (HAVE_GLOBUS and LOGGED_INTO_GLOBUS), + reason="You must have globus installed and be logged in to run this test!", +) class TestGlobusTransferContent(TestCase): def setUp(self): self.tmpdir = Path(mkdtemp()) # Globus has permission issues here apparently