configurationengine/source/plugins/symbian/ConeThemePlugin/themeplugin/tests/unittest_theme_function.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 maketheme
       
    24 from themeplugin import theme_function
       
    25 from cone.storage.filestorage import FileStorage
       
    26 
       
    27 ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
       
    28 
       
    29 class TestThemePlugin(unittest.TestCase):    
       
    30     def setUp(self):
       
    31         self.curdir = os.getcwd()
       
    32         self.output = 'output'
       
    33         pass
       
    34 
       
    35     def tearDown(self):
       
    36         pass
       
    37         
       
    38     def test_convert_hexa_to_decimal(self):
       
    39        decimal = theme_function.convert_hexa_to_decimal("a5d5f19d6e6097b8")
       
    40        self.assertEquals(decimal,"-1512705635 1851824056")
       
    41        
       
    42     def test_find_text_in_string(self):
       
    43         row_in_pkg_file = "\"themepackage.mbm\" - \"!:\\resource\\skins\\99d49b086e6097b8\\themepackage.mbm\""
       
    44         start_text = "!:\\resource\\skins\\"
       
    45         end_text = "\\"
       
    46 
       
    47         PID_number = theme_function.find_text_in_string(row_in_pkg_file,start_text, end_text)
       
    48         self.assertEquals(PID_number,"99d49b086e6097b8")
       
    49         
       
    50     def test_find_text_in_file(self):
       
    51         start_text = "!:\\resource\\skins\\"
       
    52         end_text = "\\"
       
    53         PID = theme_function.find_text_in_file(os.path.join(ROOT_PATH,"e75\\test_pkg\\themepackage.pkg"),start_text, end_text)
       
    54         self.assertEquals(PID,"99d49b086e6097b8")
       
    55 
       
    56         
       
    57 if __name__ == '__main__':
       
    58   unittest.main()