allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [05/14] git commit: [#5652] ticket:357 restore output format for wiki page api
Date Wed, 22 May 2013 13:36:31 GMT
[#5652] ticket:357 restore output format for wiki page api


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

Branch: refs/heads/cj/5913
Commit: 0d1c69e81b2777911775c6e3d091bad630ec7f63
Parents: 703ccaa
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Fri May 17 14:12:39 2013 +0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Mon May 20 17:22:10 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tests/functional/test_rest.py        |    6 +++---
 .../tests/functional/test_rest_api_tickets.py      |    4 ++--
 ForgeWiki/forgewiki/tests/functional/test_root.py  |    8 ++++----
 ForgeWiki/forgewiki/wiki_main.py                   |    2 +-
 4 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0d1c69e8/Allura/allura/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_rest.py b/Allura/allura/tests/functional/test_rest.py
index eb9dcd6..fcfb373 100644
--- a/Allura/allura/tests/functional/test_rest.py
+++ b/Allura/allura/tests/functional/test_rest.py
@@ -59,13 +59,13 @@ class TestRestHome(TestRestApiBase):
     def test_project_ping(self):
         r = self.api_get('/rest/p/test/wiki/Home/')
         assert r.status_int == 200
-        assert r.json['page']['title'] == 'Home', r.json
+        assert r.json['title'] == 'Home', r.json
 
     @td.with_tool('test/sub1', 'Wiki', 'wiki')
     def test_subproject_ping(self):
         r = self.api_get('/rest/p/test/sub1/wiki/Home/')
         assert r.status_int == 200
-        assert r.json['page']['title'] == 'Home', r.json
+        assert r.json['title'] == 'Home', r.json
 
     def test_project_code(self):
         r = self.api_get('/rest/p/test/')
@@ -105,7 +105,7 @@ class TestRestHome(TestRestApiBase):
                 'viewable_by-0.id':'all'})
         r = self.api_get('/rest/p/test/wiki/tést/')
         assert r.status_int == 200
-        assert r.json['page']['title'].encode('utf-8') == 'tést', r.json
+        assert r.json['title'].encode('utf-8') == 'tést', r.json
 
     @td.with_wiki
     def test_deny_access(self):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0d1c69e8/Allura/allura/tests/functional/test_rest_api_tickets.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_rest_api_tickets.py b/Allura/allura/tests/functional/test_rest_api_tickets.py
index 219f235..11e149f 100644
--- a/Allura/allura/tests/functional/test_rest_api_tickets.py
+++ b/Allura/allura/tests/functional/test_rest_api_tickets.py
@@ -68,7 +68,7 @@ class TestApiTicket(TestRestApiBase):
         self.set_api_ticket()
         r = self.api_get('/rest/p/test/wiki/Home/')
         assert r.status_int == 200
-        assert r.json['page']['title'] == 'Home', r.json
+        assert r.json['title'] == 'Home', r.json
 
     def test_project_ping_expired_ticket(self):
         self.set_api_ticket(timedelta(seconds=-1))
@@ -80,4 +80,4 @@ class TestApiTicket(TestRestApiBase):
         self.set_api_ticket()
         r = self.api_get('/rest/p/test/sub1/wiki/Home/')
         assert r.status_int == 200
-        assert r.json['page']['title'] == 'Home', r.json
+        assert r.json['title'] == 'Home', r.json

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0d1c69e8/ForgeWiki/forgewiki/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py
index 5682d2a..1baa28b 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_root.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_root.py
@@ -629,10 +629,10 @@ class TestRootController(TestController):
         self.app.post('/wiki/Home/attach', upload_files=[('file_info', 'test_root.py', content)])
         r = self.app.get('/rest/p/test/wiki/Home/')
         r = json.loads(r.body)
-        assert_equal(r['page']['attachments'][0]['url'], 'http://localhost:80/p/test/wiki/Home/attachment/test_root.py')
-        assert_equal(r['page']['discussion_thread_url'], 'http://localhost:80/rest%s' % discussion_url)
-        assert_equal(r['page']['discussion_thread']['_id'], discussion_url.split('/')[-2])
+        assert_equal(r['attachments'][0]['url'], 'http://localhost:80/p/test/wiki/Home/attachment/test_root.py')
+        assert_equal(r['discussion_thread_url'], 'http://localhost:80/rest%s' % discussion_url)
+        assert_equal(r['discussion_thread']['_id'], discussion_url.split('/')[-2])
         self.app.post('/wiki/Home/attach', upload_files=[('file_info', '__init__.py', content),])
         r = self.app.get('/rest/p/test/wiki/Home/')
         r = json.loads(r.body)
-        assert_equal(len(r['page']['attachments']), 2)
+        assert_equal(len(r['attachments']), 2)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0d1c69e8/ForgeWiki/forgewiki/wiki_main.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/wiki_main.py b/ForgeWiki/forgewiki/wiki_main.py
index 66d01b7..94f98a5 100644
--- a/ForgeWiki/forgewiki/wiki_main.py
+++ b/ForgeWiki/forgewiki/wiki_main.py
@@ -736,7 +736,7 @@ class PageRestController(BaseController):
 
     @expose('json:')
     def index(self, **kw):
-        return dict(page=self.page)
+        return self.page.__json__()
 
 
 class WikiAdminController(DefaultAdminController):


Mime
View raw message