23 lines
619 B
Python
23 lines
619 B
Python
|
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'))
|