587
|
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 |
|
588
|
30 |
def test_atsant_multipledrop():
|
587
|
31 |
"""test atsant and check 3 files in the file"""
|
588
|
32 |
files = atsant.files_to_test(os.path.join(os.environ['TEST_DATA'], 'data/packageiad/layers.sysdef.xml'), None, None, 'z:', 'false')
|
587
|
33 |
assert len(files) == 3
|
588
|
34 |
|
|
35 |
def test_atsant_singledrop():
|
|
36 |
"""test atsant and check 1 files in the file"""
|
|
37 |
files = atsant.files_to_test(os.path.join(os.environ['TEST_DATA'], 'data/packageiad/layers.sysdef.xml'), None, None, 'z:', 'true')
|
|
38 |
assert len(files) == 1
|
|
39 |
|
628
|
40 |
def test_atsant_multipledrop_with_sysdef3():
|
|
41 |
"""test atsant and check MULTIPLE drop files are created when sysdef3 files are in use"""
|
|
42 |
files = atsant.files_to_test(os.path.join(os.environ['TEST_DATA'], 'data/packageiad/sysdef3_test.xml'), None, None, 'z:', 'false', True)
|
|
43 |
assert len(files) == 2
|
|
44 |
|
|
45 |
def test_atsant_singledrop_with_sysdef3():
|
|
46 |
"""test atsant and check SINGLE drop file is created when sysdef3 files are in use"""
|
|
47 |
files = atsant.files_to_test(os.path.join(os.environ['TEST_DATA'], 'data/packageiad/sysdef3_test.xml'), None, None, 'z:', 'true', True)
|
|
48 |
|
|
49 |
assert len(files) == 1
|
|
50 |
|
587
|
51 |
def test_IConfigATS():
|
588
|
52 |
"""test I config ATS"""
|
587
|
53 |
tmpdir = tempfile.mkdtemp()
|
|
54 |
shutil.copy(os.path.join(os.environ['TEST_DATA'], 'data', 'example_corernd.iconfig.xml'), os.path.join(tmpdir, 'example_corernd.iconfig.xml'))
|
|
55 |
open(os.path.join(tmpdir, 'RX-60_00_rnd.core.fpsx'), 'w').close()
|
|
56 |
open(os.path.join(tmpdir, 'RX-60_00.01_rnd.rofs2.fpsx'), 'w').close()
|
|
57 |
open(os.path.join(tmpdir, 'RX-60_00_rnd.rofs3.fpsx'), 'w').close()
|
|
58 |
open(os.path.join(tmpdir, 'RX-60_00_rnd.udaerase.fpsx'), 'w').close()
|
588
|
59 |
i_c = atsant.IConfigATS(tmpdir, '')
|
|
60 |
i_c.findimages()
|