diff options
author | Ivan Malison <IvanMalison@gmail.com> | 2014-12-22 07:49:05 -0500 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2015-01-13 17:25:18 -0500 |
commit | 201bec5135f885c3ca93585c9dcbb69f22007694 (patch) | |
tree | 2310fa52cc80b9edc6b2cf330bcf7204a24d6b12 /tests | |
parent | 572a7285c6ac1e59d16dbe859138bf1ee4f6ea0b (diff) | |
download | dotfiles-201bec5135f885c3ca93585c9dcbb69f22007694.tar.gz dotfiles-201bec5135f885c3ca93585c9dcbb69f22007694.tar.bz2 dotfiles-201bec5135f885c3ca93585c9dcbb69f22007694.zip |
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
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_basic.py | 21 |
1 files changed, 20 insertions, 1 deletions
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): |