diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 22:22:28 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 22:22:28 +0200 |
commit | b01824b1aecf8aadae4501e22feb45c20fb26bce (patch) | |
tree | d4bd7e5dc1f183938e95619de1b52944e23b9724 /test/testlib/asserts.py | |
parent | 708b8dda8e7b87841a5f39c60b799c514e75a9c7 (diff) | |
download | gitpython-b01824b1aecf8aadae4501e22feb45c20fb26bce.tar.gz |
Fixed remaining tests to deal with the changes
mode is now generally an int compatible to the stat module
Diffstat (limited to 'test/testlib/asserts.py')
-rw-r--r-- | test/testlib/asserts.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/testlib/asserts.py b/test/testlib/asserts.py index 345f74ec..46fcf20e 100644 --- a/test/testlib/asserts.py +++ b/test/testlib/asserts.py @@ -8,10 +8,12 @@ import re import unittest from nose import tools from nose.tools import * +import stat __all__ = ['assert_instance_of', 'assert_not_instance_of', 'assert_none', 'assert_not_none', - 'assert_match', 'assert_not_match'] + tools.__all__ + 'assert_match', 'assert_not_match', 'assert_mode_644', + 'assert_mode_755'] + tools.__all__ def assert_instance_of(expected, actual, msg=None): """Verify that object is an instance of expected """ @@ -35,4 +37,14 @@ def assert_match(pattern, string, msg=None): def assert_not_match(pattern, string, msg=None): """verify that the pattern does not match the string""" - assert_none(re.search(pattern, string), msg)
\ No newline at end of file + assert_none(re.search(pattern, string), msg) + +def assert_mode_644(mode): + """Verify given mode is 644""" + assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP) + assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and not (mode & stat.S_IXUSR) + +def assert_mode_755(mode): + """Verify given mode is 755""" + assert (mode & stat.S_IROTH) and (mode & stat.S_IRGRP) and (mode & stat.S_IXOTH) and (mode & stat.S_IXGRP) + assert (mode & stat.S_IWUSR) and (mode & stat.S_IRUSR) and (mode & stat.S_IXUSR)
\ No newline at end of file |