allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: Make reorder test more flexible
Date Thu, 10 Mar 2016 16:14:56 GMT
Repository: allura
Updated Branches:
  refs/heads/master 9acc99ed5 -> 9647a2832


Make reorder test more flexible


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/9647a283
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/9647a283
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/9647a283

Branch: refs/heads/master
Commit: 9647a2832c7d75634eb9a6edfd24d4b0ef3dff0c
Parents: 9acc99e
Author: Heith Seewald <heiths@gmail.com>
Authored: Thu Mar 10 11:14:31 2016 -0500
Committer: Heith Seewald <heiths@gmail.com>
Committed: Thu Mar 10 11:14:31 2016 -0500

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_admin.py | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/9647a283/Allura/allura/tests/functional/test_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_admin.py b/Allura/allura/tests/functional/test_admin.py
index 2d9651b..70b1df6 100644
--- a/Allura/allura/tests/functional/test_admin.py
+++ b/Allura/allura/tests/functional/test_admin.py
@@ -1392,7 +1392,12 @@ class TestRestMountOrder(TestRestApiBase):
 
     @td.with_wiki
     def test_reorder(self):
-        data = {
+        d1 = {
+            '0': u'sub1',
+            '1': u'wiki',
+            '2': u'admin'
+        }
+        d2 = {
             '0': u'wiki',
             '1': u'sub1',
             '2': u'admin'
@@ -1407,11 +1412,20 @@ class TestRestMountOrder(TestRestApiBase):
             u'url': u'/p/test/sub1/'
         }
 
+        # Set initial order to d1
+        r = self.api_post('/rest/p/test/admin/mount_order/', **d1)
+        assert_equals(r.json['status'], 'ok')
+
+        # Get index of sub1
         a = self.api_get('/p/test/_nav.json').json['menu'].index(tool)
-        r = self.api_post('/rest/p/test/admin/mount_order/', **data)
+
+        # Set order to d2
+        r = self.api_post('/rest/p/test/admin/mount_order/', **d2)
         assert_equals(r.json['status'], 'ok')
-        after_reorder = self.api_get('/p/test/_nav.json')
-        b = after_reorder.json['menu'].index(tool)
+
+        # Get index of sub1 after reordering
+        b = self.api_get('/p/test/_nav.json').json['menu'].index(tool)
+
         assert_greater(b, a)
 
 


Mime
View raw message