def test_get_run_by_id(self):
response = self.app.get('/runs/1234')
self.assertEqual(http_client.NOT_FOUND, response.status_code)
pb = 'tests/fixtures/playbooks/hello_world.yml'
response = self.app.post(
'/runs',
data=json.dumps(dict(playbook_path=pb,
inventory_file='localhosti,',
options={'connection': 'local'})),
content_type='application/json')
res_dict = json.loads(response.data)
run_id = res_dict['id']
self.assertEqual(http_client.OK, response.status_code)
response = self.app.get('/runs/{}'.format(run_id))
self.assertEqual(http_client.OK, response.status_code)
self._wait_for_run_complete(run_id)
评论列表
文章目录