MCPcopy
hub / github.com/deadc0de6/dotdrop / test_ext_config_yaml_not_mix

Method test_ext_config_yaml_not_mix

tests/test_import.py:202–410  ·  view source on GitHub ↗

Test whether the import_configs mixes yaml files upon importing.

(self)

Source from the content-addressed store, hash-verified

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 },

Callers

nothing calls this directly

Calls 9

load_yamlMethod · 0.95
get_tempdirFunction · 0.90
create_random_fileFunction · 0.90
create_fake_configFunction · 0.90
populate_fake_configFunction · 0.90
load_optionsFunction · 0.90
cmd_importerFunction · 0.90
file_in_yamlFunction · 0.90
_remove_priv_varsFunction · 0.85

Tested by

no test coverage detected