summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2014-05-27 15:56:11 -0400
committerGravatar Jon Bernard <jbernard@tuxion.com> 2014-05-27 15:56:11 -0400
commitf9a46f13cf81b936e462fd389361e106683b315c (patch)
tree46bd2e660884d56a8075318b6a2d7c878f4e7426
parent484a53a6dba1140430c75d7d825d60d60e85bdcf (diff)
downloaddotfiles-f9a46f13cf81b936e462fd389361e106683b315c.tar.gz
dotfiles-f9a46f13cf81b936e462fd389361e106683b315c.tar.bz2
dotfiles-f9a46f13cf81b936e462fd389361e106683b315c.zip
Add test for syncing packages with a non-default prefix
This test currently fails because of a bug. In reference to #33.
-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()