aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_basic.py
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2014-01-01 11:26:42 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2014-07-07 14:21:49 -0400
commit94d31fba8d5151736dc0f0185a1c53aa93733d3d (patch)
tree11ab04d2403aa7d383fe4a698587e4ff85fb5bb2 /tests/test_basic.py
parentfc933e26004fad5e26eb29f80ef32bf33166e47d (diff)
downloaddotfiles-94d31fba8d5151736dc0f0185a1c53aa93733d3d.tar.gz
dotfiles-94d31fba8d5151736dc0f0185a1c53aa93733d3d.tar.bz2
dotfiles-94d31fba8d5151736dc0f0185a1c53aa93733d3d.zip
Add unit test for adding a package file via CLI
Re #20
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."""