Package elisa :: Package core :: Package tests :: Module test_backend
[hide private]
[frames] | no frames]

Source Code for Module elisa.core.tests.test_backend

 1  # Elisa - Home multimedia server 
 2  # Copyright (C) 2006-2008 Fluendo Embedded S.L. (www.fluendo.com). 
 3  # All rights reserved. 
 4  # 
 5  # This file is available under one of two license agreements. 
 6  # 
 7  # This file is licensed under the GPL version 3. 
 8  # See "LICENSE.GPL" in the root of this distribution including a special 
 9  # exception to use Elisa with Fluendo's plugins. 
10  # 
11  # The GPL part of Elisa is also available under a commercial licensing 
12  # agreement from Fluendo. 
13  # See "LICENSE.Elisa" in the root directory of this distribution package 
14  # for details on that license. 
15   
16  from twisted.trial import unittest 
17  from elisa.core.backend import Backend 
18  from elisa.core import config 
19  from elisa.core import interface_controller 
20   
21  MAPPINGS="""\ 
22  [test:elisa_model] 
23  supported_controllers = ['test:elisa_controller',] 
24  controller = 'test:elisa_controller' 
25  supported_views = ['test:elisa_view'] 
26  view = 'test:elisa_view' 
27  """ 
28   
29   
30 -class TestBackend(unittest.TestCase):
31
32 - def setUp(self):
33 cfg = config.Config('mappings.conf', MAPPINGS) 34 self._backend = Backend(cfg)
35
36 - def test_get_view_path(self):
37 38 path = self._backend.get_controller_path('test:elisa_model') 39 self.assertEquals(path, 'test:elisa_controller') 40 41 self.assertRaises(interface_controller.UndefinedMVCAssociation, 42 self._backend.get_controller_path, 'foo:bar')
43