def setUpClass(cls):
""" Set up test fixture.
Skip the tests if it is not possible to connect to the Spark Master.
"""
paas = SparkPaaS()
try:
master_url = "http://{}:{}".format(
paas.spark_master['url'], paas.spark_master['master_port'])
req = requests.get(master_url)
if not req.ok:
raise unittest.SkipTest('No 200 response from Spark Master '
'@[{}], Skipping tests.'.
format(master_url))
except requests.exceptions.RequestException:
print('Exception thrown..')
raise unittest.SkipTest("Cannot connect to Spark Master @ [{}]. "
"Skipping tests.". format(master_url))
cls.paas = paas
test_paas_spark.py 文件源码
python
阅读 14
收藏 0
点赞 0
评论 0
评论列表
文章目录