aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2016-07-18 15:36:41 -0400
committerGravatar Jon Bernard <jbernard@tuxion.com> 2016-07-18 15:36:41 -0400
commitaf991f612a54d347deb5449aec273012c2c059df (patch)
tree46bfed4f4892c8b8dca82f62e09f4c1bb1e29567 /tests
parente09398c6ef5af049a28b88690911343ba5238e67 (diff)
downloaddotfiles-af991f612a54d347deb5449aec273012c2c059df.tar.gz
dotfiles-af991f612a54d347deb5449aec273012c2c059df.tar.bz2
dotfiles-af991f612a54d347deb5449aec273012c2c059df.zip
Reverse leading dot logic
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py2
-rw-r--r--tests/test_repository.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index f5beb21..9e1d16a 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -8,7 +8,7 @@ from dotfiles.repository import Repository
def repo(request, tmpdir):
path = tmpdir.ensure_dir('repo')
home = tmpdir.ensure_dir(request.param)
- return Repository(path, home)
+ return Repository(path, homedir=home)
@pytest.fixture(scope='function')
diff --git a/tests/test_repository.py b/tests/test_repository.py
index 73d5315..58e6cf9 100644
--- a/tests/test_repository.py
+++ b/tests/test_repository.py
@@ -25,20 +25,20 @@ def test_str(repo):
@pytest.mark.parametrize('path', ['.foo', '.foo/bar/baz'])
def test_dotfile_path(repo, path):
- repo.preserve_leading_dot = True
+ repo.remove_leading_dot = False
assert (repo._dotfile_path(repo.path.join(path)) ==
repo.homedir.join(path))
- repo.preserve_leading_dot = False
+ repo.remove_leading_dot = True
assert (repo._dotfile_path(repo.path.join(path)) ==
repo.homedir.join('.%s' % path))
@pytest.mark.parametrize('path', ['.foo', '.foo/bar/baz'])
def test_dotfile_target(repo, path):
- repo.preserve_leading_dot = True
+ repo.remove_leading_dot = False
assert (repo._dotfile_target(repo.homedir.join(path)) ==
repo.path.join(path))
- repo.preserve_leading_dot = False
+ repo.remove_leading_dot = True
assert (repo._dotfile_target(repo.homedir.join(path)) ==
repo.path.join(path[1:]))
@@ -48,7 +48,7 @@ def test_dotfile(repo):
repo._dotfile(py.path.local('/tmp/foo'))
with pytest.raises(TargetIgnored):
repo.ignore_patterns = ['.foo']
- repo.preserve_leading_dot = True
+ repo.remove_leading_dot = False
repo._dotfile(py.path.local(repo.homedir.join('.foo')))
with pytest.raises(TargetIgnored):
repo.ignore_patterns = ['foo']