configurationengine/source/plugins/symbian/ConeHCRPlugin/hcrplugin/tests/unittest_hcrml_writer.py
equal
deleted
inserted
replaced
12 # Contributors: |
12 # Contributors: |
13 # |
13 # |
14 # Description: |
14 # Description: |
15 # |
15 # |
16 |
16 |
17 import os, unittest |
17 import os |
18 import __init__ |
|
19 |
18 |
20 from hcrplugin.hcrrepository import HcrRepository, HcrRecord |
|
21 from hcrplugin.hcr_writer import HcrWriter |
|
22 from hcrplugin import hcr_exceptions |
|
23 from cone.public import api, plugin |
19 from cone.public import api, plugin |
24 from testautomation.base_testcase import BaseTestCase |
20 from testautomation.base_testcase import BaseTestCase |
25 |
21 |
26 |
22 |
27 ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
23 ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) |
35 |
31 |
36 self.remove_if_exists(output_dir) |
32 self.remove_if_exists(output_dir) |
37 |
33 |
38 prj = api.Project(api.Storage.open(project_dir)) |
34 prj = api.Project(api.Storage.open(project_dir)) |
39 config = prj.get_configuration('root.confml') |
35 config = prj.get_configuration('root.confml') |
|
36 context = plugin.GenerationContext(configuration=config, output=output_dir) |
40 impls = plugin.ImplFactory.get_impls_from_file(hcrml_file, config) |
37 impls = plugin.ImplFactory.get_impls_from_file(hcrml_file, config) |
41 self.assertEquals(len(impls), 1) |
38 self.assertEquals(len(impls), 1) |
42 impl = impls[0] |
39 impl = impls[0] |
43 impl.set_output_root(output_dir) |
40 impl.generate(context) |
44 impl.generate() |
|
45 |
41 |
46 if expected_dir != None: |
42 if expected_dir != None: |
47 self.assert_dir_contents_equal(expected_dir, output_dir, ['.svn']) |
43 self.assert_dir_contents_equal(expected_dir, output_dir, ['.svn']) |
48 else: |
44 else: |
49 self.assertFalse(os.path.exists(output_dir)) |
45 self.assertFalse(os.path.exists(output_dir)) |