• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


Commit MetaInfo

Révisionc9be7efe0a04af08d06636a593f73adbe6ad5935 (tree)
l'heure2012-07-11 11:18:25
AuteurDave Brondsema <dbrondsema@geek...>
CommiterDave Brondsema

Message de Log

[#4272] fix api tests to use proper HTTP verb

Change Summary

Modification

--- a/ForgeTracker/forgetracker/tests/functional/test_rest.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py
@@ -60,7 +60,7 @@ class TestRestUpdateTicket(TestTrackerApiBase):
6060 self.ticket_args = ticket_view.json['ticket']
6161
6262 def test_ticket_index(self):
63- tickets = self.api_post('/rest/p/test/bugs/')
63+ tickets = self.api_get('/rest/p/test/bugs/')
6464 assert len(tickets.json['tickets']) == 1, tickets.json
6565 assert (tickets.json['tickets'][0]
6666 == dict(ticket_num=1, summary='test new ticket')), tickets.json['tickets'][0]
@@ -94,22 +94,22 @@ class TestRestDiscussion(TestTrackerApiBase):
9494 self.ticket_args = ticket_view.json['ticket']
9595
9696 def test_index(self):
97- r = self.api_post('/rest/p/test/bugs/_discuss/')
97+ r = self.api_get('/rest/p/test/bugs/_discuss/')
9898 assert len(r.json['discussion']['threads']) == 1, r.json
9999 for t in r.json['discussion']['threads']:
100- r = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % t['_id'])
100+ r = self.api_get('/rest/p/test/bugs/_discuss/thread/%s/' % t['_id'])
101101 assert len(r.json['thread']['posts']) == 0, r.json
102102
103103 def test_post(self):
104- discussion = self.api_post('/rest/p/test/bugs/_discuss/').json['discussion']
104+ discussion = self.api_get('/rest/p/test/bugs/_discuss/').json['discussion']
105105 post = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/new' % discussion['threads'][0]['_id'],
106106 text='This is a comment', wrap_args=None)
107- thread = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id'])
107+ thread = self.api_get('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id'])
108108 assert len(thread.json['thread']['posts']) == 1, thread.json
109109 assert post.json['post']['text'] == 'This is a comment', post.json
110110 reply = self.api_post(
111111 '/rest/p/test/bugs/_discuss/thread/%s/%s/reply' % (thread.json['thread']['_id'], post.json['post']['slug']),
112112 text='This is a reply', wrap_args=None)
113113 assert reply.json['post']['text'] == 'This is a reply', reply.json
114- thread = self.api_post('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id'])
114+ thread = self.api_get('/rest/p/test/bugs/_discuss/thread/%s/' % discussion['threads'][0]['_id'])
115115 assert len(thread.json['thread']['posts']) == 2, thread.json