configurationengine/source/plugins/symbian/ConeThemePlugin/themeplugin/tests/unittest_theme_resource.py
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
equal deleted inserted replaced
-1:000000000000 0:2e8eeb919028
       
     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 
       
    17 import unittest, os, shutil
       
    18 
       
    19 import __init__    
       
    20 from cone.public import exceptions,plugin,api
       
    21 from cone.storage import filestorage
       
    22 from cone.confml import implml
       
    23 from themeplugin import theme_resource
       
    24 from cone.storage.filestorage import FileStorage
       
    25 
       
    26 ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
       
    27 
       
    28 class TestThemePlugin(unittest.TestCase):    
       
    29     def setUp(self):
       
    30         self.curdir = os.getcwd()
       
    31         self.output = 'output'
       
    32         pass
       
    33 
       
    34     def tearDown(self):
       
    35         pass
       
    36     
       
    37     def test_modify_resource_path(self):
       
    38         resource = theme_resource.ThemeResource()
       
    39         path = resource.modify_resource_path("!:\\private\\10207114\\import\\f99553e36ea1a92f\\themepackage.mbm")
       
    40         self.assertEquals(path,"private\\10207114\\import\\f99553e36ea1a92f")
       
    41 
       
    42     def test_parse_pkg_file(self):
       
    43         resource = theme_resource.ThemeResource()
       
    44         resource.parse_pkg_file(os.path.join(ROOT_PATH,"e75\\test_pkg\\themepackage2.pkg"))
       
    45         if len(resource.list_resource) > 0:
       
    46             filename = resource.list_resource[0].get_filename()
       
    47             self.assertEquals(filename,"themepackage.mbm")
       
    48             path = resource.list_resource[0].get_path()
       
    49             self.assertEquals(path,"private\\10207114\\import\\f99553e36ea1a92f")
       
    50         else:
       
    51             self.assertFalse()
       
    52 
       
    53         
       
    54 if __name__ == '__main__':
       
    55   unittest.main()