configurationengine/source/plugins/example/ConeExampleValidatorPlugin/examplevalidatorplugin/tests/unittest_validation.py
changeset 3 e7e0ae78773e
equal deleted inserted replaced
2:87cfa131b535 3:e7e0ae78773e
       
     1 #
       
     2 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 # All rights reserved.
       
     4 # This component and the accompanying materials are made available
       
     5 # under the terms of "Eclipse Public License v1.0"
       
     6 # which accompanies this distribution, and is available
       
     7 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 #
       
     9 # Initial Contributors:
       
    10 # Nokia Corporation - initial contribution.
       
    11 #
       
    12 # Contributors:
       
    13 #
       
    14 # Description: 
       
    15 #
       
    16 
       
    17 import os
       
    18 
       
    19 ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
       
    20 
       
    21 from testautomation.base_testcase import BaseTestCase
       
    22 from cone.public import api
       
    23 from cone.validation import confmlvalidation
       
    24 
       
    25 class TestExampleValidatorValidation(BaseTestCase):
       
    26     
       
    27     def test_validate(self):
       
    28         project_dir = os.path.join(ROOT_PATH, 'testdata')
       
    29         config      = 'test.confml'
       
    30         
       
    31         prj = api.Project(api.Storage.open(project_dir))
       
    32         config = prj.get_configuration(config)
       
    33         problems = confmlvalidation.validate_configuration(config).problems
       
    34         
       
    35         self.assert_problem_list_equals_expected(
       
    36             actual = problems,
       
    37             expected_file = os.path.join(ROOT_PATH, 'testdata/expected.txt'),
       
    38             outdir = os.path.join(ROOT_PATH, 'temp'))