[Kimchi-devel] [PATCH V4 3/3] update case for root.get redirection

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Fri Jun 27 07:34:26 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

update test case.

when the user access kimchi firt time, root.get will redirect to
login.html instead of kimchi-ui.html.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 tests/test_rest.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/test_rest.py b/tests/test_rest.py
index 18ba66e..6aa5348 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -131,13 +131,17 @@ def test_accepts(self):
           If neither of the above, HTTP:406
         """
         resp = self.request("/", headers={})
+        location = resp.getheader('location')
+        self.assertTrue(location.endswith("login.html"))
+        resp = self.request("/login.html", headers={})
         self.assertTrue('<!doctype html>' in resp.read().lower())
 
         resp = self.request("/", headers={'Accept': 'application/json'})
         self.assertValidJSON(resp.read())
 
         resp = self.request("/", headers={'Accept': 'text/html'})
-        self.assertTrue('<!doctype html>' in resp.read().lower())
+        location = resp.getheader('location')
+        self.assertTrue(location.endswith("login.html"))
 
         resp = self.request("/", headers={'Accept':
                                           'application/json, text/html'})
-- 
1.9.3




More information about the Kimchi-devel mailing list