From 541429c26eb47aaedd417bf2460d58af54687427 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Sun, 8 Apr 2018 23:17:40 +0300 Subject: [PATCH] tests: cloud: fix naming scheme Signed-off-by: Ruslan Kuprieiev --- tests/test_data_cloud.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/tests/test_data_cloud.py b/tests/test_data_cloud.py index 3201814d4..b5c627cf6 100644 --- a/tests/test_data_cloud.py +++ b/tests/test_data_cloud.py @@ -25,7 +25,7 @@ TEST_AWS_REPO_REGION = 'us-east-2' TEST_GCP_REPO_BUCKET = 'dvc-test' -def should_test_aws(): +def _should_test_aws(): dvc_test_aws = os.getenv("DVC_TEST_AWS") if dvc_test_aws == "true": return True @@ -38,7 +38,7 @@ def should_test_aws(): return False -def should_test_gcp(): +def _should_test_gcp(): if os.getenv("DVC_TEST_GCP") == "true": return True @@ -52,7 +52,7 @@ def should_test_gcp(): return False -def should_test_ssh(): +def _should_test_ssh(): if os.getenv("DVC_TEST_SSH") == "true": return True @@ -68,7 +68,8 @@ def should_test_ssh(): os.system('cp mykey.pub ~/.ssh/id_rsa.pub') os.system('cat mykey.pub >> ~/.ssh/authorized_keys') os.system('ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts') - assert os.system('ssh 127.0.0.1 ls') == 0 + + assert os.system('ssh 127.0.0.1 ls &> /dev/null') == 0 return True @@ -190,7 +191,7 @@ class TestDataCloudBase(TestDvc): class TestDataCloudAWS(TestDataCloudBase): def _setup_cloud(self): - if not should_test_aws(): + if not _should_test_aws(): return repo = get_aws_url() @@ -203,13 +204,13 @@ class TestDataCloudAWS(TestDataCloudBase): self.cloud = DataCloudAWS(cloud_settings) def test(self): - if should_test_aws(): + if _should_test_aws(): self._test_cloud() class TestDataCloudGCP(TestDataCloudBase): def _setup_cloud(self): - if not should_test_gcp(): + if not _should_test_gcp(): return repo = get_gcp_url() @@ -221,7 +222,7 @@ class TestDataCloudGCP(TestDataCloudBase): self.cloud = DataCloudGCP(cloud_settings) def test(self): - if should_test_gcp(): + if _should_test_gcp(): self._test_cloud() @@ -280,7 +281,7 @@ class TestDataCloudCLIBase(TestDvc): self.main(['status', '-c'] + args) - def should_test(self): + def _should_test(self): return True def _test(self): @@ -290,7 +291,7 @@ class TestDataCloudCLIBase(TestDvc): pass def test(self): - if self.should_test(): + if self._should_test(): self._test() self._test_compat() @@ -312,8 +313,8 @@ class TestDataCloudLOCALCLI(TestDataCloudCLIBase): class TestDataCloudSSHCLI(TestDataCloudCLIBase): - def should_test(self): - return should_test_ssh() + def _should_test(self): + return _should_test_ssh() def _test_compat(self): # We do not support ssh in legacy mode @@ -328,8 +329,8 @@ class TestDataCloudSSHCLI(TestDataCloudCLIBase): class TestDataCloudAWSCLI(TestDataCloudCLIBase): - def should_test(self): - return should_test_aws() + def _should_test(self): + return _should_test_aws() def _test_compat(self): storagepath = get_aws_storagepath() @@ -349,8 +350,8 @@ class TestDataCloudAWSCLI(TestDataCloudCLIBase): class TestDataCloudGCPCLI(TestDataCloudCLIBase): - def should_test(self): - return should_test_gcp() + def _should_test(self): + return _should_test_gcp() def _test_compat(self): storagepath = get_gcp_storagepath()