add osusers.tests.test_tasks.LdapRouterTest

This commit is contained in:
Jan Dittberner 2014-06-01 23:22:13 +02:00
parent f01c3dbabb
commit 2204f7df43

View file

@ -0,0 +1,22 @@
from django.test import TestCase
from osusers.tasks import LdapRouter
class LdapRouterTest(TestCase):
def setUp(self):
self.router = LdapRouter()
super(LdapRouterTest, self).setUp()
def test_ldap_tasks_are_routed_to_ldap_queue(self):
route = self.router.route_for_task(
'some_ldap_task')
self.assertEqual(
route,
{'exchange': 'ldap',
'exchange_type': 'direct',
'queue': 'ldap'})
def test_non_ldap_tasks_are_routed_to_default(self):
self.assertIsNone(
self.router.route_for_task('other'))