645
|
1 |
#============================================================================
|
|
2 |
#Name : test_quality.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 the archive.py module."""
|
|
21 |
|
|
22 |
from __future__ import with_statement
|
|
23 |
import os
|
|
24 |
import unittest
|
|
25 |
import logging
|
|
26 |
import fileutils
|
|
27 |
import pythoncorecpythontests.test_fileutils
|
|
28 |
import integration.quality
|
|
29 |
|
|
30 |
_logger = logging.getLogger('test.quality')
|
|
31 |
|
|
32 |
|
|
33 |
root_test_dir = pythoncorecpythontests.test_fileutils.root_test_dir
|
|
34 |
|
|
35 |
def setup_module():
|
|
36 |
""" Creates some test data files for file-related testing. """
|
|
37 |
pythoncorecpythontests.test_fileutils.setup_module()
|
|
38 |
|
|
39 |
def teardown_module():
|
|
40 |
""" Cleans up test data files for file-related testing. """
|
|
41 |
pythoncorecpythontests.test_fileutils.teardown_module()
|
|
42 |
|
|
43 |
|
|
44 |
class QualityTest(unittest.TestCase):
|
|
45 |
|
|
46 |
def test_epl_validate_content(self):
|
|
47 |
"""Tests loading policy ID's from CSV file for EPL"""
|
|
48 |
pattern = "distribution.policy.s60,distribution.policy,distribution.policy.pp"
|
|
49 |
ignoreroot = False
|
|
50 |
excludes = ".static_wa,_ccmwaid.inf"
|
|
51 |
validator = integration.quality.PolicyValidator(pattern, ignoreroot=ignoreroot, excludes=excludes)
|
|
52 |
|
|
53 |
validator.epl_load_policy_ids(os.path.join(os.environ['TEST_DATA'], 'data/distribution.policy.extended_for_sf.id_status.csv'))
|
|
54 |
|
|
55 |
assert validator.epl_validate_content(os.path.join(os.environ['TEST_DATA'], 'data/distribution.policy.S60')) == True
|
|
56 |
assert validator.epl_validate_content(os.path.join(os.environ['TEST_DATA'], 'data/Invalid_distribution.policy.S60')) == False
|
|
57 |
|
|
58 |
if __name__ == "__main__":
|
|
59 |
unittest.main()
|