def test_cli_delete(self): r = run("cms var delete deleteme") v = Variables() print("Result:", r) print("Variable:", v) assert v['deleteme'] != 'abc'
def test_describe(self): result = run([ 'curl', 'http://localhost:8080/api/describe?cluster=?{}'.format( self.clusterid) ], shell=False) assert result is not None assert result[0] == "{"
def test_list_instances(self): result = run([ 'curl', 'http://localhost:8080/api/list_instances?cluster=?{}'.format( self.clusterid) ], shell=False) assert result is not None assert result[0] == "{"
def test_run(self): result = run([ 'curl', 'http://localhost:8080/api/run?cluster=?{}&bucket=test&bucketname=' 'test.py'.format(self.clusterid) ], shell=False) assert result is not None assert result[0] == "{"
def test_stop_cluster(self): result = run([ 'curl', 'http://localhost:8080/api/stop?cluster=?{}'.format( self.clusterid) ], shell=False) assert result is not None assert result[0] == "{" self.clusterid = ""
def test_start_cluster(self): result = run([ 'curl', 'http://localhost:8080/api/start?name=pytest-cluster&count=2' ], shell=False) assert result is not None assert result[0] == "{" self.clusterid = result[16:31]
def test_cli_list(self): r = run("cms var list") v = Variables() print(r) assert v['deleteme'] == 'abc' assert "deleteme='abc'" in r
def test_cli_get(self): r = run("cms var deleteme") v = Variables() print(r) assert v['deleteme'] == 'abc'
def test_list_clusters(self): result = run(['curl', 'http://localhost:8080/api/list_clusters'], shell=False) assert result is not None assert result[0] == "["
def run_curl(command): StopWatch.start(command) output = run(['curl', command], shell=False) StopWatch.stop(command) return output