Merge "basic tox.ini for python 2.7 and python 3 unittests"
[yardstick.git] / tests / unit / apiserver / resources / test_env_action.py
1 from __future__ import absolute_import
2
3 import time
4 import unittest
5
6 from tests.unit.apiserver import APITestCase
7
8
9 class EnvTestCase(APITestCase):
10
11     def test_create_grafana(self):
12         url = 'yardstick/env/action'
13         data = dict(action='createGrafanaContainer')
14         resp = self._post(url, data)
15
16         time.sleep(1)
17
18         task_id = resp['result']['task_id']
19         url = '/yardstick/asynctask?task_id={}'.format(task_id)
20         resp = self._get(url)
21
22         time.sleep(2)
23
24         self.assertTrue(u'status' in resp)
25
26
27 def main():
28     unittest.main()
29
30
31 if __name__ == '__main__':
32     main()