aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@jbernard.io> 2018-04-17 00:29:39 -0400
committerGravatar Jon Bernard <jbernard@jbernard.io> 2018-04-17 00:29:39 -0400
commitae6723be0c94e1e979523efbffa39cd0f422db41 (patch)
tree45e5cd3abf635dc06acfc3a9d1a419f437c7c08d /tests
parentac17ca0db70d40873ba07ecc11e1c12a5c8bd021 (diff)
downloaddotfiles-ae6723be0c94e1e979523efbffa39cd0f422db41.tar.gz
dotfiles-ae6723be0c94e1e979523efbffa39cd0f422db41.tar.bz2
dotfiles-ae6723be0c94e1e979523efbffa39cd0f422db41.zip
Parameterize a couple unit tests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_dotfile.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/test_dotfile.py b/tests/test_dotfile.py
index 4d81c6c..9d04eed 100644
--- a/tests/test_dotfile.py
+++ b/tests/test_dotfile.py
@@ -11,15 +11,17 @@ def _dotfile(repo, name, target=None):
repo.path.join(target if target is not None else name))
-def test_str(repo):
- dotfile = _dotfile(repo, '.a', '.b')
- assert str(dotfile) == repo.homedir.join('.a')
+@pytest.mark.parametrize('name', ['.a'])
+def test_str(repo, name):
+ dotfile = _dotfile(repo, name, '.b')
+ assert str(dotfile) == repo.homedir.join(name)
-def test_short_name(repo):
- dotfile = _dotfile(repo, '.foo')
- assert dotfile.name == repo.homedir.join('.foo')
- assert dotfile.short_name(repo.homedir) == '.foo'
+@pytest.mark.parametrize('name', ['.foo'])
+def test_short_name(repo, name):
+ dotfile = _dotfile(repo, name)
+ assert dotfile.name == repo.homedir.join(name)
+ assert dotfile.short_name(repo.homedir) == name
def test_state_error(repo):