for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
if __name__ == "__main__":
import sys
sys.path.insert(0, '..')
sys.path.insert(0, '../..')
from hamcrest.library.integration.match_equality import *
from hamcrest.core.core.isequal import equal_to
from hamcrest.core.string_description import tostring
import unittest
__author__ = "Chris Rose"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
class MatchEqualityWrapperTest(unittest.TestCase):
def testMatcherIsEqualWhenMatchesIsTrue(self):
matcher = equal_to('bar')
assert match_equality(matcher) == 'bar'
def testMatcherIsNotEqualWhenMatchesIsFalse(self):
assert match_equality(matcher) != 'foo'
def testMatcherStringIsMatcherDescription(self):
assert str(match_equality(matcher)) == tostring(matcher)
def testMatcherReprIsMatcher(self):
assert repr(match_equality(matcher)) == tostring(matcher)
def testMatchesWhenProvidedAnObject(self):
assert match_equality('bar') == 'bar'
unittest.main()