diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_basic.py | 19 | ||||
-rw-r--r-- | tests/test_sync.py | 19 |
2 files changed, 19 insertions, 19 deletions
diff --git a/tests/test_basic.py b/tests/test_basic.py index 58e35ed..20019bb 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -37,25 +37,6 @@ class DotfilesTestCase(unittest.TestCase): os.path.realpath(path1), os.path.realpath(path2)) - def test_sync(self): - """Basic sync operation.""" - - touch(os.path.join(self.repository, 'foo')) - - dotfiles = Dotfiles(homedir=self.homedir, - path=self.repository, - prefix='', - ignore=[], - externals={}, - packages=[], - dry_run=False) - - dotfiles.sync() - - self.assertPathEqual( - os.path.join(self.homedir, '.foo'), - os.path.join(self.repository, 'foo')) - def test_force_sync_directory(self): """Test forced sync when the dotfile is a directory. diff --git a/tests/test_sync.py b/tests/test_sync.py new file mode 100644 index 0000000..e8a51cc --- /dev/null +++ b/tests/test_sync.py @@ -0,0 +1,19 @@ +from dotfiles.core import Dotfiles + + +def test_sync(tmpdir): + """Basic sync operation.""" + + dotfile = tmpdir.ensure('Dotfiles/foo') + symlink = tmpdir.join('.foo') + + Dotfiles(homedir=str(tmpdir), + path=str(dotfile.dirname), + prefix='', + ignore=[], + externals={}, + packages=[], + dry_run=False).sync() + + assert symlink.check(link=1) + assert symlink.samefile(dotfile) |