Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
disable unit test when no cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Sep 17, 2016
1 parent 8bbff82 commit 9188def
Show file tree
Hide file tree
Showing 4 changed files with 834 additions and 1,403 deletions.
15 changes: 10 additions & 5 deletions _unittests/ut_remote/test_azure.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def test_ls(self):
try: try:
df = self.client.ls(self.blob_serv, None) df = self.client.ls(self.blob_serv, None)
except azure.common.AzureException as e: except azure.common.AzureException as e:
warnings.warn("Unable to test azure, storage is still up?\n" + str(e)) warnings.warn(
"Unable to test azure, storage is still up?\n" + str(e))
return return
fLOG(df) fLOG(df)
assert isinstance(df, pandas.DataFrame) assert isinstance(df, pandas.DataFrame)
Expand Down Expand Up @@ -115,9 +116,11 @@ def test_upload_download(self):
else: else:
df = self.client.ls(self.blob_serv, self.container, "unittest") df = self.client.ls(self.blob_serv, self.container, "unittest")
for name in df["name"]: for name in df["name"]:
self.client.delete_blob(self.blob_serv, self.container, name) self.client.delete_blob(
self.blob_serv, self.container, name)
except azure.common.AzureException as e: except azure.common.AzureException as e:
warnings.warn("Unable to test azure, storage is still up?\n" + str(e)) warnings.warn(
"Unable to test azure, storage is still up?\n" + str(e))
return return


content = self.client.ls(self.blob_serv, self.container, "unittest") content = self.client.ls(self.blob_serv, self.container, "unittest")
Expand Down Expand Up @@ -239,9 +242,11 @@ def test_script_pig(self):


import azure.common import azure.common
try: try:
content = self.client.ls(self.blob_serv, self.container, "unittest2") content = self.client.ls(
self.blob_serv, self.container, "unittest2")
except azure.common.AzureException as e: except azure.common.AzureException as e:
warnings.warn("Unable to test azure, storage is still up?\n" + str(e)) warnings.warn(
"Unable to test azure, storage is still up?\n" + str(e))
return return


if len(content) == 0: if len(content) == 0:
Expand Down
6 changes: 4 additions & 2 deletions _unittests/ut_remote/test_azure_hive.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import os import os
import unittest import unittest
import requests import requests
import warnings
thisfold = os.path.abspath(os.path.split(__file__)[0]) thisfold = os.path.abspath(os.path.split(__file__)[0])
thiscomm = os.path.join(thisfold, "..") thiscomm = os.path.join(thisfold, "..")
sys.path.append(thiscomm) sys.path.append(thiscomm)
Expand Down Expand Up @@ -99,11 +100,12 @@ def test_script_hive(self):
f.write(hive) f.write(hive)


fLOG("submit") fLOG("submit")
import azure.common
try: try:
job = self.client.hive_submit(self.blob_serv, self.container, job = self.client.hive_submit(self.blob_serv, self.container,
hivefile, params=dict(UTT="unittest3")) hivefile, params=dict(UTT="unittest3"))
except requests.exceptions.ConnectionError: except (requests.exceptions.ConnectionError, azure.common.AzureException) as e:
# cluster not available warnings.warn("Cluster not available\n{0}".format(e))
return return
fLOG(job) fLOG(job)
#not working #not working
Expand Down
Loading

0 comments on commit 9188def

Please sign in to comment.