コード例 #1
0
ファイル: load.py プロジェクト: chadwhitacre/public
 def __eq__(self, other):
     """This is mostly here to ease testing.
     """
     try:
         assert utils.cmp_routines(self.handle, other.handle)
         assert self._rules == other._rules
         assert sorted(self._funcs.keys()) == sorted(other._funcs.keys())
         for k, v in self._funcs.items():
             assert utils.cmp_routines(v, other._funcs[k])
         return True
     except AssertionError:
         return False
コード例 #2
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_mixed():
    assert not u.cmp_routines(function, Class)
コード例 #3
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_mixed2():
    assert not u.cmp_routines(function, Class().call)
コード例 #4
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_instances():
    assert u.cmp_routines(Class(), Class())
コード例 #5
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_classes():
    assert u.cmp_routines(Class, Class)
コード例 #6
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_functions():
    assert u.cmp_routines(function, function)
コード例 #7
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_mixed_methods():  # actually, this should probably fail
    assert u.cmp_routines(Class().call, Class.call)
コード例 #8
0
ファイル: test_utils.py プロジェクト: chadwhitacre/public
def test_cmp_routines_unbound_methods():
    assert u.cmp_routines(Class.call, Class.call)