configurationengine/source/cone/confml/tests/unittest_implml.py
author terytkon
Thu, 11 Mar 2010 17:04:37 +0200
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
permissions -rw-r--r--
Adding EPL version of configurationengine.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     1
#
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
# All rights reserved.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
# This component and the accompanying materials are made available
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
# under the terms of "Eclipse Public License v1.0"
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
# which accompanies this distribution, and is available
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
#
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
# Initial Contributors:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
# Nokia Corporation - initial contribution.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
#
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
# Contributors:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
#
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
# Description: 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
#
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
import unittest
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
import os
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
import __init__
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
from cone.public.exceptions import NotSupportedException
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
from cone.confml import implml
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
class TestImplementation(unittest.TestCase):    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
    def setUp(self):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
        pass
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
    def test_create_implml(self):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
        imp = implml.Implml('test.txt',None)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
    def test_generate_not_supported(self):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
        try:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
            imp = implml.Implml('test.txt',None)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
            imp.generate()
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
            self.fail("Implementation base class should not support generation")
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
        except NotSupportedException:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
            pass
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
#    def test_list_output_files(self):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
#        imp = implml.Implml('ref/test.txt',None,ROOT_PATH)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
#        files = imp.list_output_files()
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
#        self.assertTrue(len(files)>0)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
        
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
if __name__ == '__main__':
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
    unittest.main()