aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ratson <github@ratson.name> 2015-11-22 19:08:27 +0800
committerGravatar Ratson <github@ratson.name> 2015-11-22 19:08:27 +0800
commit6dc56beebea6103d3fb70244df950bacc049f9fa (patch)
treef29873a0ae872cc8773c1a1aba08a7225b8cdc63
parentb730764eab39905bcab13fdf08e86a9d420158fb (diff)
downloaddotfiles-6dc56beebea6103d3fb70244df950bacc049f9fa.tar.gz
dotfiles-6dc56beebea6103d3fb70244df950bacc049f9fa.tar.bz2
dotfiles-6dc56beebea6103d3fb70244df950bacc049f9fa.zip
Fix package and prefix test
-rw-r--r--dotfiles/core.py4
-rw-r--r--tests/test_basic.py1
2 files changed, 2 insertions, 3 deletions
diff --git a/dotfiles/core.py b/dotfiles/core.py
index a0c3a40..eba9ef8 100644
--- a/dotfiles/core.py
+++ b/dotfiles/core.py
@@ -139,7 +139,7 @@ class Dotfiles(object):
"""Recursive helper for :meth:`_load`."""
src_dir = os.path.join(self.repository, sub_dir)
- if sub_dir:
+ if sub_dir and not self.prefix:
# Add a dot to first level of packages
dst_dir = os.path.join(self.homedir, '.%s' % sub_dir)
else:
@@ -158,7 +158,7 @@ class Dotfiles(object):
self._load_recursive(pkg_path)
else:
add_dot = False if self.no_dot_prefix else not bool(sub_dir)
- self.dotfiles.append(Dotfile(dotfile[len(self.prefix):],
+ self.dotfiles.append(Dotfile(dotfile,
os.path.join(src_dir, dotfile),
dst_dir, add_dot=add_dot,
dry_run=self.dry_run))
diff --git a/tests/test_basic.py b/tests/test_basic.py
index ad6a7ab..a36b688 100644
--- a/tests/test_basic.py
+++ b/tests/test_basic.py
@@ -405,7 +405,6 @@ class DotfilesTestCase(unittest.TestCase):
self.assertTrue(os.path.islink(
os.path.join(self.homedir, '.config/gtk-3.0')))
- @pytest.mark.xfail()
def test_package_and_prefix(self):
"""Test syncing a package when using a non-default prefix."""