aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test_dotfiles.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test_dotfiles.py b/test_dotfiles.py
index 2b93de6..bdb3439 100644
--- a/test_dotfiles.py
+++ b/test_dotfiles.py
@@ -5,11 +5,14 @@ from dotfiles import Repository, Dotfile, cli
class TestCli(object):
- @pytest.mark.xfail(reason='global overrides not working')
def test_status(self, runner, repo, home, monkeypatch):
- # FIXME: this approach does not work
- monkeypatch.setattr('dotfiles.DEFAULT_HOMEDIR', str(home))
- monkeypatch.setattr('dotfiles.DEFAULT_REPO_PATH', str(repo))
+
+ def repo_init(self, *args, **kwargs):
+ self.ignore = []
+ self.homedir = home
+ self.repodir = repo.ensure(dir=1)
+
+ monkeypatch.setattr(Repository, '__init__', repo_init)
result = runner.invoke(cli, ['status'])
assert not result.exception