aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_repository.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_repository.py')
-rw-r--r--tests/test_repository.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_repository.py b/tests/test_repository.py
index 58e6cf9..60ae8e3 100644
--- a/tests/test_repository.py
+++ b/tests/test_repository.py
@@ -1,7 +1,8 @@
import pytest
import py.path
-from dotfiles.repository import Repository
+from dotfiles.repository import Repository, \
+ DEFAULT_REMOVE_LEADING_DOT, DEFAULT_IGNORE_PATTERNS
from dotfiles.exceptions import NotRootedInHome, InRepository, TargetIgnored, \
IsDirectory
@@ -13,6 +14,22 @@ def test_repo_create(repo):
assert repo.path.check(exists=1, dir=1)
+@pytest.mark.parametrize('remove_leading_dot',
+ [DEFAULT_REMOVE_LEADING_DOT,
+ not DEFAULT_REMOVE_LEADING_DOT])
+@pytest.mark.parametrize('ignore_patterns', [DEFAULT_IGNORE_PATTERNS,
+ ['foo', 'bar', 'baz']])
+def test_repo_params(repo, remove_leading_dot, ignore_patterns):
+ _repo = Repository(repo.path,
+ remove_leading_dot=remove_leading_dot,
+ ignore_patterns=ignore_patterns,
+ homedir=repo.homedir)
+ assert _repo.path == repo.path
+ assert _repo.homedir == repo.homedir
+ assert _repo.remove_leading_dot == remove_leading_dot
+ assert _repo.ignore_patterns == ignore_patterns
+
+
def test_str(repo):
repo.path.ensure('a')
repo.path.ensure('b')