Permalink
Browse files

adding test case for deprecated methods

  • Loading branch information...
1 parent 078beaa commit 7a8bb1daf0bcaeba6264bfad3a0fcd86351bf44a @romand romand committed Aug 17, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 test.py
View
19 test.py
@@ -41,6 +41,25 @@ def test_clearQueue(self):
q.clear()
self.assertEqual(q.size(), 0)
+ def test_deprecated(self):
+ self.assertEqual(self.mq.queues(), self.mq.getQueues())
+
+ name = 'test_queue'
+ q = self.mq.queue(name)
+
+ self.assertEqual('Cleared', self.mq.clearQueue(name)['msg'])
+
+ self.assertEqual(0, q.size())
+
+ info = self.mq.getQueueDetails(name)
+ self.assertEqual(q.info(), info)
+
+ msg_id = self.mq.postMessage(name, ['hello mq'])['ids'][0]
+
+ resp = self.mq.getMessage(name)
+ self.assertEqual(msg_id, resp['messages'][-1]['id'])
+
+ self.assertEqual('Deleted', self.mq.deleteMessage(name, msg_id)['msg'])
if __name__ == '__main__':
unittest.main()

0 comments on commit 7a8bb1d

Please sign in to comment.