From 9bdcb71bfa216521016c5091550d41524959fb39 Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Thu, 31 Dec 2015 11:22:40 -0500 Subject: Add invalid test for dotfile class --- tests/test_dotfile.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') diff --git a/tests/test_dotfile.py b/tests/test_dotfile.py index e679caf..7b99db1 100644 --- a/tests/test_dotfile.py +++ b/tests/test_dotfile.py @@ -1,5 +1,6 @@ import pytest import py.error + from dotfiles.dotfile import Dotfile @@ -70,3 +71,19 @@ def test_sync(tmpdir, times): assert target.check(file=1, link=0) assert name.check(file=1, link=1) assert name.samefile(target) + + +def test_valid(tmpdir): + + repo = tmpdir.join("Dotfiles", dir=1) + name = tmpdir.join(".vimrc") + target = repo.ensure("vimrc") + name.mksymlinkto(target) + + dotfile = Dotfile(name, target) + + assert '(unknown)' == dotfile.state + assert True == dotfile.invalid() + + dotfile.state = '(ok)' + assert False == dotfile.invalid() -- cgit v1.2.3