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