Bladeren bron

更新测试脚本

James Iter 9 jaren geleden
bovenliggende
commit
ab34ae703c
2 gewijzigde bestanden met toevoegingen van 18 en 18 verwijderingen
  1. 17 17
      tests/test_guest.py
  2. 1 1
      tests/test_os_init_write.py

+ 17 - 17
tests/test_guest.py

@@ -27,23 +27,23 @@ class TestGuest(unittest.TestCase):
 
     # 创建Guest
     # @unittest.skip('skip create guest')
-    def test_11_create(self):
-        payload = {
-            "cpu": 4,
-            "memory": 4,
-            "os_template_id": 1,
-            "quantity": 1,
-            "name": "",
-            "password": "pswd.com",
-            "lease_term": 100
-        }
-
-        url = TestGuest.base_url + '/guest'
-        headers = {'content-type': 'application/json'}
-        r = requests.post(url, data=json.dumps(payload), headers=headers)
-        j_r = json.loads(r.content)
-        print json.dumps(j_r, ensure_ascii=False)
-        self.assertEqual('200', j_r['state']['code'])
+    # def test_11_create(self):
+    #     payload = {
+    #         "cpu": 4,
+    #         "memory": 4,
+    #         "os_template_id": 6,
+    #         "quantity": 2,
+    #         "name": "",
+    #         "password": "pswd.com",
+    #         "lease_term": 100
+    #     }
+    #
+    #     url = TestGuest.base_url + '/guest'
+    #     headers = {'content-type': 'application/json'}
+    #     r = requests.post(url, data=json.dumps(payload), headers=headers)
+    #     j_r = json.loads(r.content)
+    #     print json.dumps(j_r, ensure_ascii=False)
+    #     self.assertEqual('200', j_r['state']['code'])
 
     # 获取 Guest 列表
     # def test_12_get_list(self):

+ 1 - 1
tests/test_os_init_write.py

@@ -186,7 +186,7 @@ class TestOSInitWrite(unittest.TestCase):
     #     payload = {
     #         "os_init_id": 8,
     #         "path": "/etc/hostname",
-    #         "content": "{HOSTNAME}"
+    #         "content": "hostname=\"{HOSTNAME}\""
     #     }
     #
     #     url = TestOSInitWrite.base_url + '/os_init_write'