Test whether the import_configs mixes yaml files upon importing.
(self)
| 200 | self.assertTrue(editcontent == cont) |
| 201 | |
| 202 | def test_ext_config_yaml_not_mix(self): |
| 203 | """Test whether the import_configs mixes yaml files upon importing.""" |
| 204 | # dotfiles on filesystem |
| 205 | src = get_tempdir() |
| 206 | self.assertTrue(os.path.exists(src)) |
| 207 | self.addCleanup(clean, src) |
| 208 | |
| 209 | # create some random dotfiles |
| 210 | dotfiles = [] |
| 211 | for _ in range(3): |
| 212 | dotfile, _ = create_random_file(src) |
| 213 | dotfiles.append(dotfile) |
| 214 | self.addCleanup(clean, dotfile) |
| 215 | self.assertTrue(all(map(os.path.exists, dotfiles))) |
| 216 | |
| 217 | # create dotdrop home |
| 218 | dotdrop_home = get_tempdir() |
| 219 | self.assertTrue(os.path.exists(dotdrop_home)) |
| 220 | self.addCleanup(clean, dotdrop_home) |
| 221 | |
| 222 | dotpath_ed = 'imported' |
| 223 | imported = { |
| 224 | 'config': { |
| 225 | 'dotpath': dotpath_ed, |
| 226 | }, |
| 227 | 'dotfiles': {}, |
| 228 | 'profiles': { |
| 229 | 'host1': { |
| 230 | 'dotfiles': [], |
| 231 | }, |
| 232 | }, |
| 233 | 'actions': { |
| 234 | 'pre': { |
| 235 | 'a_pre_log_ed': 'echo pre 2', |
| 236 | }, |
| 237 | 'post': { |
| 238 | 'a_post_log_ed': 'echo post 2', |
| 239 | }, |
| 240 | 'a_log_ed': 'echo 2', |
| 241 | }, |
| 242 | 'trans_install': { |
| 243 | 't_log_ed': 'echo 3', |
| 244 | }, |
| 245 | 'trans_update': { |
| 246 | 'tw_log_ed': 'echo 4', |
| 247 | }, |
| 248 | 'variables': { |
| 249 | 'v_log_ed': '42', |
| 250 | }, |
| 251 | 'dynvariables': { |
| 252 | 'dv_log_ed': 'echo 5', |
| 253 | }, |
| 254 | } |
| 255 | dotpath_ing = 'importing' |
| 256 | importing = { |
| 257 | 'config': { |
| 258 | 'dotpath': dotpath_ing, |
| 259 | }, |
nothing calls this directly
no test coverage detected