diff options
author | Jon Bernard <jbernard@tuxion.com> | 2014-01-01 11:26:42 -0500 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2014-07-07 14:21:49 -0400 |
commit | 94d31fba8d5151736dc0f0185a1c53aa93733d3d (patch) | |
tree | 11ab04d2403aa7d383fe4a698587e4ff85fb5bb2 /tests/test_basic.py | |
parent | fc933e26004fad5e26eb29f80ef32bf33166e47d (diff) | |
download | dotfiles-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-x | tests/test_basic.py | 24 |
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.""" |