From 59d276bbfd84bf256dcaee6447f692ca4f5cfeab Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Fri, 5 Oct 2018 12:10:59 -0400 Subject: Begin conversion of repository._dotfile() to pathlib --- tests/test_repository.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'tests/test_repository.py') diff --git a/tests/test_repository.py b/tests/test_repository.py index ef78001..ed8543c 100644 --- a/tests/test_repository.py +++ b/tests/test_repository.py @@ -1,6 +1,7 @@ import pytest from pathlib import Path +from dotfiles.exceptions import NotRootedInHome from dotfiles.repository import Repository, \ REMOVE_LEADING_DOT, IGNORE_PATTERNS @@ -86,17 +87,15 @@ def test_dotfile_target(repo, path): repo.path / path[1:]) -# from dotfiles.exceptions import NotRootedInHome, InRepository, TargetIgnored, -# IsDirectory +def test_dotfile(repo): + with pytest.raises(NotRootedInHome): + repo._dotfile(Path('/tmp/foo')) + # with pytest.raises(TargetIgnored): + # repo.ignore_patterns = ['.foo'] + # repo.remove_leading_dot = False + # repo._dotfile(py.path.local(repo.homedir.join('.foo'))) + # repo._dotfile(repo.homedir / '.foo') - -# def test_dotfile(repo): -# with pytest.raises(NotRootedInHome): -# repo._dotfile(py.path.local('/tmp/foo')) -# with pytest.raises(TargetIgnored): -# repo.ignore_patterns = ['.foo'] -# repo.remove_leading_dot = False -# repo._dotfile(py.path.local(repo.homedir.join('.foo'))) # with pytest.raises(TargetIgnored): # repo.ignore_patterns = ['foo'] # repo._dotfile(repo.homedir.join('.bar/foo')) -- cgit v1.2.3