diff options
author | Jon Bernard <jbernard@tuxion.com> | 2015-12-31 11:22:40 -0500 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2015-12-31 11:25:04 -0500 |
commit | 9bdcb71bfa216521016c5091550d41524959fb39 (patch) | |
tree | 43dca47b367998ceff87ab8c85cd8743a9d4e96c /tests | |
parent | ee9279c23cf2b734f4cfde558e909ca4acefa421 (diff) | |
download | dotfiles-9bdcb71bfa216521016c5091550d41524959fb39.tar.gz dotfiles-9bdcb71bfa216521016c5091550d41524959fb39.tar.bz2 dotfiles-9bdcb71bfa216521016c5091550d41524959fb39.zip |
Add invalid test for dotfile class
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_dotfile.py | 17 |
1 files changed, 17 insertions, 0 deletions
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() |