59 'layer2/root.confml', |
59 'layer2/root.confml', |
60 'layer3/root.confml', |
60 'layer3/root.confml', |
61 'layer5/root.confml', |
61 'layer5/root.confml', |
62 'layer6/root.confml', |
62 'layer6/root.confml', |
63 'test/one/root.confml']) |
63 'test/one/root.confml']) |
64 |
64 |
|
65 def test_get_flat_configuration_with_nonexistent_files(self): |
|
66 TEMP_DIR = os.path.join(ROOT_PATH,'temp2') |
|
67 if os.path.exists(TEMP_DIR): |
|
68 shutil.rmtree(TEMP_DIR) |
|
69 |
|
70 # Create a configuration with some non-existent layers |
|
71 prj = api.Project(api.Storage.open(TEMP_DIR, 'w')) |
|
72 prj.create_configuration('test/one/root.confml', True) |
|
73 |
|
74 rootconf1 = prj.create_configuration('product1_root.confml', True) |
|
75 rootconf1.create_configuration('layer1/root.confml') |
|
76 rootconf1.include_configuration('nonexistent1/root.confml') |
|
77 |
|
78 rootconf2 = prj.create_configuration('product2_root.confml', True) |
|
79 rootconf2.create_configuration('layer3/root.confml') |
|
80 rootconf2.include_configuration('nonexistent2/root.confml') |
|
81 |
|
82 fooconf = prj.create_configuration('test/foo.confml', True) |
|
83 fooconf.include_configuration('/product1_root.confml') |
|
84 fooconf.include_configuration('/product2_root.confml') |
|
85 rootconf1.include_configuration('/nonexistent_product_root.confml') |
|
86 fooconf.include_configuration('/test/one/root.confml') |
|
87 fooconf.include_configuration('nonexistent3/root.confml') |
|
88 prj.save() |
|
89 prj.close() |
|
90 |
|
91 action = configroot2flat.ConeConfigroot2FlatAction( |
|
92 project=TEMP_DIR, |
|
93 configs=['test/foo.confml']) |
|
94 action.run() |
|
95 |
|
96 prj = api.Project(api.Storage.open(TEMP_DIR, 'r')) |
|
97 fooconf = prj.get_configuration('foo.confml') |
|
98 self.assertEquals(fooconf.list_configurations(), |
|
99 ['layer1/root.confml', |
|
100 'nonexistent1/root.confml', |
|
101 'layer3/root.confml', |
|
102 'nonexistent2/root.confml', |
|
103 'test/one/root.confml', |
|
104 'nonexistent3/root.confml']) |
|
105 |