Create a fake config file
(path, dotfile, profile, dotpath)
| 15 | |
| 16 | |
| 17 | def fake_config(path, dotfile, profile, dotpath): |
| 18 | """Create a fake config file""" |
| 19 | with open(path, 'w', encoding='utf-8') as file: |
| 20 | file.write('config:\n') |
| 21 | file.write(' backup: true\n') |
| 22 | file.write(' create: true\n') |
| 23 | file.write(f' dotpath: {dotpath}\n') |
| 24 | file.write('dotfiles:\n') |
| 25 | file.write(f' {dotfile.key}:\n') |
| 26 | file.write(f' dst: {dotfile.dst}\n') |
| 27 | file.write(f' src: {dotfile.src}\n') |
| 28 | file.write('profiles:\n') |
| 29 | file.write(f' {profile}:\n') |
| 30 | file.write(' dotfiles:\n') |
| 31 | file.write(f' - {dotfile.key}\n') |
| 32 | return path |
| 33 | |
| 34 | |
| 35 | class TestJhelpers(unittest.TestCase): |