From f9a46f13cf81b936e462fd389361e106683b315c Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Tue, 27 May 2014 15:56:11 -0400 Subject: Add test for syncing packages with a non-default prefix This test currently fails because of a bug. In reference to #33. --- test_dotfiles.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test_dotfiles.py') diff --git a/test_dotfiles.py b/test_dotfiles.py index fbdae37..0e84435 100755 --- a/test_dotfiles.py +++ b/test_dotfiles.py @@ -358,5 +358,33 @@ class DotfilesTestCase(unittest.TestCase): self.assertFalse(os.path.islink(os.path.join(self.homedir, '.config'))) + def test_package_and_prefix(self): + """Test syncing a package when using a non-default prefix.""" + + package_dir = os.path.join(self.repository, '.config/awesome') + os.makedirs(package_dir) + touch('%s/testfile' % package_dir) + + dotfiles = core.Dotfiles(homedir=self.homedir, + repository=self.repository, + prefix='.', + ignore=[], + externals={}, + packages=['.config'], + dry_run=False, + quiet=True) + + dotfiles.sync() + + expected = os.path.join(self.homedir, ".config") + self.assertTrue(os.path.islink(expected)) + + expected = os.path.join(expected, "awesome") + self.assertTrue(os.path.isdir(expected)) + + expected = os.path.join(expected, "testfile") + self.assertTrue(os.path.isfile(expected)) + + if __name__ == '__main__': unittest.main() -- cgit v1.2.3