0
|
1 |
#
|
|
2 |
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
# All rights reserved.
|
|
4 |
# This component and the accompanying materials are made available
|
|
5 |
# under the terms of "Eclipse Public License v1.0"
|
|
6 |
# which accompanies this distribution, and is available
|
|
7 |
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
#
|
|
9 |
# Initial Contributors:
|
|
10 |
# Nokia Corporation - initial contribution.
|
|
11 |
#
|
|
12 |
# Contributors:
|
|
13 |
#
|
|
14 |
# Description:
|
|
15 |
#
|
|
16 |
|
3
|
17 |
import unittest, os, sys
|
0
|
18 |
|
|
19 |
from themeplugin import theme_resource
|
|
20 |
|
|
21 |
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
|
|
22 |
|
|
23 |
class TestThemePlugin(unittest.TestCase):
|
|
24 |
def setUp(self):
|
|
25 |
self.curdir = os.getcwd()
|
|
26 |
self.output = 'output'
|
|
27 |
pass
|
|
28 |
|
|
29 |
def tearDown(self):
|
|
30 |
pass
|
|
31 |
|
|
32 |
def test_modify_resource_path(self):
|
|
33 |
resource = theme_resource.ThemeResource()
|
|
34 |
path = resource.modify_resource_path("!:\\private\\10207114\\import\\f99553e36ea1a92f\\themepackage.mbm")
|
|
35 |
self.assertEquals(path,"private\\10207114\\import\\f99553e36ea1a92f")
|
|
36 |
|
|
37 |
def test_parse_pkg_file(self):
|
|
38 |
resource = theme_resource.ThemeResource()
|
|
39 |
resource.parse_pkg_file(os.path.join(ROOT_PATH,"e75\\test_pkg\\themepackage2.pkg"))
|
|
40 |
if len(resource.list_resource) > 0:
|
|
41 |
filename = resource.list_resource[0].get_filename()
|
|
42 |
self.assertEquals(filename,"themepackage.mbm")
|
|
43 |
path = resource.list_resource[0].get_path()
|
|
44 |
self.assertEquals(path,"private\\10207114\\import\\f99553e36ea1a92f")
|
|
45 |
else:
|
|
46 |
self.assertFalse()
|
|
47 |
|
3
|
48 |
# Only run these tests on Windows
|
|
49 |
if sys.platform != 'win32':
|
|
50 |
del TestThemePlugin
|
0
|
51 |
|
|
52 |
if __name__ == '__main__':
|
3
|
53 |
unittest.main()
|