incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [01/21] git commit: [#6267] ticket:360 A little more tests for wiki api
Date Wed, 29 May 2013 23:11:55 GMT
Updated Branches:
  refs/heads/cj/4994 488c5335b -> 956b6c5f1 (forced update)


[#6267] ticket:360 A little more tests for wiki 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/067705d6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/067705d6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/067705d6

Branch: refs/heads/cj/4994
Commit: 067705d61f4e28592a99904c007ea4be8a6eddce
Parents: a3e7f32
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Fri May 24 13:25:05 2013 +0000
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Mon May 27 09:02:18 2013 +0000

----------------------------------------------------------------------
 ForgeWiki/forgewiki/tests/functional/test_rest.py |   18 +++++++++++++++-
 1 files changed, 17 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/067705d6/ForgeWiki/forgewiki/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/tests/functional/test_rest.py b/ForgeWiki/forgewiki/tests/functional/test_rest.py
index af1080a..f6f8714 100644
--- a/ForgeWiki/forgewiki/tests/functional/test_rest.py
+++ b/ForgeWiki/forgewiki/tests/functional/test_rest.py
@@ -1,3 +1,4 @@
+# coding: utf-8
 import json
 
 from nose.tools import assert_equal
@@ -32,7 +33,11 @@ class TestWikiApi(TestRestApiBase):
         r = json.loads(r.body)
         assert_equal(len(r['attachments']), 2)
 
-    def test_post_page(self):
+    def test_page_does_not_exist(self):
+        r = self.api_get('/rest/p/test/wiki/fake/')
+        assert_equal(r.status_int, 404)
+
+    def test_update_page(self):
         data = {
             'text': 'Embrace the Dark Side',
             'labels': 'head hunting,dark side'
@@ -42,3 +47,14 @@ class TestWikiApi(TestRestApiBase):
         r = self.api_get('/rest/p/test/wiki/Home/')
         assert_equal(r.json['text'], data['text'])
         assert_equal(r.json['labels'], data['labels'].split(','))
+
+    def test_create_page(self):
+        data = {
+            'text': 'Embrace the Dark Side',
+            'labels': 'head hunting,dark side'
+        }
+        r = self.api_post(u'/rest/p/test/wiki/tést/'.encode('utf-8'), **data)
+        assert_equal(r.status_int, 200)
+        r = self.api_get(u'/rest/p/test/wiki/tést/'.encode('utf-8'))
+        assert_equal(r.json['text'], data['text'])
+        assert_equal(r.json['labels'], data['labels'].split(','))


Mime
View raw message