Browse Source

Add regression test for the message options bug.

Ask Solem 16 years ago
parent
commit
773a389f2a
1 changed files with 16 additions and 0 deletions
  1. 16 0
      celery/tests/test_messaging.py

+ 16 - 0
celery/tests/test_messaging.py

@@ -0,0 +1,16 @@
+import unittest
+from celery.messaging import MSG_OPTIONS, get_msg_options, extract_msg_options
+
+
+class TestMsgOptions(unittest.TestCase):
+
+    def test_MSG_OPTIONS(self):
+        self.assertTrue(MSG_OPTIONS)
+
+    def test_extract_msg_options(self):
+        testing = {"mandatory": True, "routing_key": "foo.xuzzy"}
+        result = extract_msg_options(testing)
+        self.assertEquals(result["mandatory"], True)
+        self.assertEquals(result["routing_key"], "foo.xuzzy")
+
+