|
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() |