179
|
1 |
#============================================================================
|
|
2 |
#Name : test_iqrf.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 |
""" Test cases for iqrf module. """
|
|
21 |
import unittest
|
|
22 |
import os
|
|
23 |
import imaker.iqrf
|
|
24 |
|
|
25 |
|
|
26 |
class Test_iQRF(unittest.TestCase):
|
|
27 |
""" Test for iQRF data access. """
|
|
28 |
|
|
29 |
def test_file_parsing_5250(self):
|
|
30 |
""" Testing if the iqrf module is able to load the 5250 configuration. """
|
|
31 |
root = imaker.iqrf.load(os.path.join(os.environ['HELIUM_HOME'], "tests/data/iqrf/imaker_5250.xml"))
|
|
32 |
assert root.result != None
|
|
33 |
assert len(root.result.targets) == 228
|
|
34 |
assert len(root.result.interfaces) == 1
|
|
35 |
assert len(root.result.configurations) == 6
|
|
36 |
|
|
37 |
# testing a configurations
|
|
38 |
assert root.result.configurations[0].name == "image_conf_product52.mk"
|
|
39 |
assert root.result.configurations[0].filePath == r"\epoc32\rom\config\platform\product52\image_conf_product52.mk"
|
|
40 |
assert len(root.result.configurations[0].targetrefs) == 38
|
|
41 |
assert root.result.configurations[0].targetrefs[0].name == "all"
|
|
42 |
|
|
43 |
# testing interfaces
|
|
44 |
print "root.result.configurations[0].filePath: %s" % root.result.configurations[0].filePath
|
|
45 |
assert len(root.result.interfaces[0].configurationElements) == 516
|