diff options
author | Jon Bernard <jbernard@tuxion.com> | 2014-07-17 17:37:30 -0400 |
---|---|---|
committer | Jon Bernard <jbernard@tuxion.com> | 2014-07-17 17:37:30 -0400 |
commit | 936ad4fdd233f2be8e3b92ad2ee060e027fc6eac (patch) | |
tree | e7e982ea9bc17938bcd0ddb09f4944c1302a1fac /tests/test_core.py | |
parent | 43b496d0e0a57115c86d57c1e5d1709f8de2be9f (diff) | |
download | dotfiles-936ad4fdd233f2be8e3b92ad2ee060e027fc6eac.tar.gz dotfiles-936ad4fdd233f2be8e3b92ad2ee060e027fc6eac.tar.bz2 dotfiles-936ad4fdd233f2be8e3b92ad2ee060e027fc6eac.zip |
Experiments with using pytest for tests
Diffstat (limited to 'tests/test_core.py')
-rw-r--r-- | tests/test_core.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py new file mode 100644 index 0000000..a425e24 --- /dev/null +++ b/tests/test_core.py @@ -0,0 +1,34 @@ +import os +import pytest +from utils import HomeDirectory +from dotfiles.core import Dotfiles as Repository + + +REPOSITORY = 'dotfiles' + + +def test_sync(tmpdir): + """the quick, brown fox jumps over the lazy dog. + + lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod + tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo + consequat. duis aute irure dolor in reprehenderit in voluptate velit esse + cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat + non proident, sunt in culpa qui officia deserunt mollit anim id est + laborum""" + + contents = {'.foo': True, + '.bar': True, + '.baz': False} + + homedir = HomeDirectory(str(tmpdir), REPOSITORY, contents) + + Repository(homedir=homedir.path, + repository=os.path.join(homedir.path, REPOSITORY), + prefix='', ignore=[], externals={}, packages=[], + dry_run = False).sync() + + # .baz should now exist and link to the correct location + contents['.baz'] = True + homedir.verify(contents) |