From 201bec5135f885c3ca93585c9dcbb69f22007694 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 22 Dec 2014 07:49:05 -0500 Subject: Add no_dot_prefix option This utility can easily be used for synchronizing arbitrary configuration folders with symlinks that may not necessarily be the home directory. I have encountered several use cases where the files that I want to manage with 'dotfiles' should not/can not be prefixed with a '.'. Fixes #47 --- tests/test_basic.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_basic.py b/tests/test_basic.py index 07646af..41d1c0e 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -266,7 +266,6 @@ class DotfilesTestCase(unittest.TestCase): dotfiles.add([os.path.join(self.homedir, package_file)]) - def test_single_sync(self): """ Test syncing a single file in the repo @@ -361,6 +360,26 @@ class DotfilesTestCase(unittest.TestCase): dotfiles.add(['.config']) self.assertFalse(os.path.islink(os.path.join(self.homedir, '.config'))) + def test_no_dot_prefix(self): + # define the repository contents + repo_files = ('bashrc', 'netrc', 'vimrc') + + # populate the repository + for dotfile in repo_files: + touch(os.path.join(self.repository, dotfile)) + + dotfiles = Dotfiles( + homedir=self.homedir, path=self.repository, + prefix='', ignore=[], externals={}, packages=[], + dry_run=False, no_dot_prefix=True) + + dotfiles.sync() + + # verify home directory contents + for dotfile in repo_files: + self.assertPathEqual( + os.path.join(self.repository, dotfile), + os.path.join(self.homedir, dotfile)) @pytest.mark.xfail() def test_add_package_file(self): -- cgit v1.2.3