aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_package.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_package.py b/tests/test_package.py
new file mode 100644
index 0000000..ddc5787
--- /dev/null
+++ b/tests/test_package.py
@@ -0,0 +1,21 @@
+from dotfiles.core import Dotfiles
+
+
+def test_package_sync(tmpdir):
+ """Test syncing a package."""
+
+ repository = tmpdir.ensure('Dotfiles', dir=1)
+ dotfile = repository.ensure('config/awesome/testfile')
+
+ Dotfiles(homedir=str(tmpdir),
+ path=str(repository),
+ prefix='',
+ ignore=[],
+ externals={},
+ packages=['config'],
+ dry_run=False,
+ quiet=True).sync()
+
+ assert tmpdir.join('.config').check(dir=1)
+ assert tmpdir.join('.config/awesome').check(link=1)
+ assert tmpdir.join('.config/awesome').samefile(dotfile.dirname)