|
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 unittest, os, shutil, sys |
|
18 |
|
19 import __init__ |
|
20 from genconfmlplugin import xslttransformer |
|
21 from cone.public import exceptions,plugin,api |
|
22 from cone.storage import filestorage |
|
23 from cone.confml import implml |
|
24 |
|
25 # Hardcoded value of testdata folder that must be under the current working dir |
|
26 ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
|
27 testdata = os.path.join(ROOT_PATH,'project') |
|
28 |
|
29 class TestGenconfmlPlugin(unittest.TestCase): |
|
30 def setUp(self): |
|
31 self.curdir = os.getcwd() |
|
32 self.output = 'output' |
|
33 pass |
|
34 |
|
35 def tearDown(self): |
|
36 pass |
|
37 |
|
38 def test_transform(self): |
|
39 ''' |
|
40 Test that the xslt transformation works |
|
41 ''' |
|
42 transformer = xslttransformer.XsltTransformer() |
|
43 transformer.transform_lxml(os.path.join(ROOT_PATH,"xslt\cdcatalog.xml"), |
|
44 os.path.join(ROOT_PATH,"xslt\cdcatalog_ex1.xsl"), |
|
45 "testioutput.xml", |
|
46 sys.getdefaultencoding()) |
|
47 os.unlink("testioutput.xml") |
|
48 |
|
49 |
|
50 if __name__ == '__main__': |
|
51 unittest.main() |