aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_basic.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_basic.py')
-rwxr-xr-xtests/test_basic.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_basic.py b/tests/test_basic.py
index 2cd019f..c5a2a9b 100755
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -358,6 +358,30 @@ class DotfilesTestCase(unittest.TestCase):
self.assertFalse(os.path.islink(os.path.join(self.homedir, '.config')))
+ def test_add_package_file(self):
+ """
+ Test adding a package that isn't already in the repository
+
+ """
+
+ package_dir = os.path.join(self.homedir,
+ '.%s/%s' % ('config', 'gtk-3.0'))
+
+ 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)
+
+ # This should succeed and the directory structure in the repository
+ # should be created since it didn't already exist.
+ dotfiles.add(['.config/gtk-3.0'])
+ self.assertTrue(os.path.islink(
+ os.path.join(self.homedir, '.config/gtk-3.0')))
+
+
def test_package_and_prefix(self):
"""Test syncing a package when using a non-default prefix."""