aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest_dotfiles.py28
1 files changed, 28 insertions, 0 deletions
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()