detect include cycles between profiles
(self)
| 252 | self.assertEqual(cfg.variables.get('from_right'), 'R') |
| 253 | |
| 254 | def test_include_loop_detection(self): |
| 255 | """detect include cycles between profiles""" |
| 256 | tmp = get_tempdir() |
| 257 | self.assertTrue(os.path.exists(tmp)) |
| 258 | self.addCleanup(clean, tmp) |
| 259 | |
| 260 | confpath = create_fake_config(tmp, |
| 261 | configname=self.CONFIG_NAME, |
| 262 | dotpath=self.CONFIG_DOTPATH, |
| 263 | backup=self.CONFIG_BACKUP, |
| 264 | create=self.CONFIG_CREATE) |
| 265 | |
| 266 | content = yaml_load(confpath) |
| 267 | content['profiles'] = { |
| 268 | 'a': {'include': ['b']}, |
| 269 | 'b': {'include': ['a']} |
| 270 | } |
| 271 | yaml_dump(content, confpath) |
| 272 | |
| 273 | with self.assertRaises(YamlException): |
| 274 | Cfg(confpath, profile='a', debug=True) |
| 275 | |
| 276 | def test_include_dag_user_example(self): |
| 277 | """user-reported DAG includes should not be treated as loops""" |
nothing calls this directly
no test coverage detected