buildframework/helium/sf/python/pythoncore/lib/pythoncorecpythontests/test_atsant.py
changeset 587 85df38eb4012
child 588 c7c26511138f
child 618 df88fead2976
equal deleted inserted replaced
217:0f5e3a7fb6af 587:85df38eb4012
       
     1 #============================================================================ 
       
     2 #Name        : test_atsant.py 
       
     3 #Part of     : Helium 
       
     4 
       
     5 #Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     6 #All rights reserved.
       
     7 #This component and the accompanying materials are made available
       
     8 #under the terms of the License "Eclipse Public License v1.0"
       
     9 #which accompanies this distribution, and is available
       
    10 #at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
    11 #
       
    12 #Initial Contributors:
       
    13 #Nokia Corporation - initial contribution.
       
    14 #
       
    15 #Contributors:
       
    16 #
       
    17 #Description:
       
    18 #===============================================================================
       
    19 
       
    20 """ atsant.py module tests. """
       
    21 
       
    22 import os
       
    23 import logging
       
    24 import tempfile
       
    25 import shutil
       
    26 _logger = logging.getLogger('test.atsant')
       
    27 
       
    28 import atsant
       
    29 
       
    30 def test_atsant():
       
    31     """test atsant and check 3 files in the file"""
       
    32     files = atsant.files_to_test(os.path.join(os.environ['TEST_DATA'], 'data/packageiad/layers.sysdef.xml'), None, None, 'z:')
       
    33     assert len(files) == 3
       
    34     
       
    35 def test_IConfigATS():
       
    36     tmpdir = tempfile.mkdtemp()
       
    37     shutil.copy(os.path.join(os.environ['TEST_DATA'], 'data', 'example_corernd.iconfig.xml'), os.path.join(tmpdir, 'example_corernd.iconfig.xml'))
       
    38     open(os.path.join(tmpdir, 'RX-60_00_rnd.core.fpsx'), 'w').close()
       
    39     open(os.path.join(tmpdir, 'RX-60_00.01_rnd.rofs2.fpsx'), 'w').close()
       
    40     open(os.path.join(tmpdir, 'RX-60_00_rnd.rofs3.fpsx'), 'w').close()
       
    41     open(os.path.join(tmpdir, 'RX-60_00_rnd.udaerase.fpsx'), 'w').close()
       
    42     ic = atsant.IConfigATS(tmpdir)
       
    43     ic.findimages()