File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ class TestDssApi(unittest.TestCase):
2626
2727 @classmethod
2828 def setUpClass (cls ):
29- cls .client = hca .dss .DSSClient ()
29+ # Explicitly set to dss-integration rather than what the local config is set to.
30+ # Ensures no bundles are uploaded to dss-prod from operators machine.
31+ cls .client = hca .dss .DSSClient (swagger_url = "https://dss.integration.data.humancellatlas.org/v1/swagger.json" )
3032
3133 def test_set_host (self ):
3234 with tempfile .TemporaryDirectory () as home :
Original file line number Diff line number Diff line change @@ -26,6 +26,10 @@ class TestDssApiRetry(unittest.TestCase):
2626
2727 @classmethod
2828 def setUpClass (cls ):
29+ # Explicitly set to dss-integration rather than what the local config is set to.
30+ # Ensures no bundles are uploaded to dss-prod from operators machine.
31+ cls .client = hca .dss .DSSClient (swagger_url = "https://dss.integration.data.humancellatlas.org/v1/swagger.json" )
32+
2933 with tempfile .TemporaryDirectory () as src_dir :
3034 bundle_path = os .path .join (src_dir , "bundle" )
3135 os .makedirs (bundle_path )
@@ -49,7 +53,7 @@ def test_get_retry(self):
4953 Test that GET methods are retried. We instruct the server to fake a 504 with some probability, and we should
5054 retry until successful.
5155 """
52- client = hca . dss . DSSClient ()
56+ client = self . client
5357 file_uuid = str (uuid .uuid4 ())
5458 creator_uid = client .config .get ("creator_uid" , 0 )
5559 version = datetime .utcnow ().strftime ("%Y-%m-%dT%H%M%S.%fZ" )
Original file line number Diff line number Diff line change 2424
2525
2626class TestDssCLI (unittest .TestCase ):
27+ @classmethod
28+ def setUpClass (cls ):
29+ """
30+ These tests rely on a logged in env, ensure that the current stage is not dss-prod
31+ """
32+ config = hca .get_config ()
33+ if "https://dss.data.humancellatlas.org" in config ['DSSClient' ]['swagger_url' ]:
34+ raise ValueError ('Please change the DSS swagger endpoint in the HCA config file away from `dss-prod`\n '
35+ 'For more information see: `https://github.com/HumanCellAtlas/dcp-cli#development`' )
36+
2737 def test_post_search_cli (self ):
2838 query = json .dumps ({})
2939 replica = "aws"
You can’t perform that action at this time.
0 commit comments