add osusers.tests.test_tasks.LdapRouterTest
This commit is contained in:
parent
f01c3dbabb
commit
2204f7df43
1 changed files with 22 additions and 0 deletions
22
gnuviechadmin/osusers/tests/test_tasks.py
Normal file
22
gnuviechadmin/osusers/tests/test_tasks.py
Normal 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'))
|
Loading…
Reference in a new issue