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

Source Code for Module elisa.core.tests.test_theme

 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 elisa.base_components.theme import Theme 
17  from elisa.core.tests.elisa_test_case import ElisaTestCase 
18  from elisa.core import common, config 
19  import os, platform 
20   
21 -class TestTheme(ElisaTestCase):
22 """ 23 test theme base clasee 24 to test : trial elisa.core.tests.test_theme 25 """ 26
27 - def __init__(self, methodName='runTest'):
28 ElisaTestCase.__init__(self, methodName) 29 if platform.system() == 'Windows': 30 self.skip = "test not supported under windows"
31
32 - def setUp(self):
35
36 - def test_get_media(self):
37 """ 38 check get_file_path function 39 """ 40 plugin_registry = common.application.plugin_registry 41 conf = config.Config('empty.conf') 42 test_theme = Theme() 43 44 base_plugin = plugin_registry.plugin_classes['base'] 45 test_theme.plugin = base_plugin 46 47 config_path = base_plugin.directory + '/themes/empty_theme.conf' 48 test_theme.config_file = config_path 49 image_path = test_theme.get_media('unknown_icon') 50 paths = image_path.split('/') 51 self.assertEquals(paths[-1], 'unknown.png')
52