Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_hash.HashInheritanceTestCase Class Reference

List of all members.

Public Member Functions

def test_default_hash
def test_fixed_hash
def test_error_hash
def test_hashable
def test_not_hashable

Static Public Attributes

list default_expected
list fixed_expected
list error_expected

Detailed Description

Definition at line 65 of file test_hash.py.


Member Function Documentation

Definition at line 78 of file test_hash.py.

00078 
00079     def test_default_hash(self):
00080         for obj in self.default_expected:
00081             self.assertEqual(hash(obj), _default_hash(obj))

Here is the call graph for this function:

Definition at line 86 of file test_hash.py.

00086 
00087     def test_error_hash(self):
00088         for obj in self.error_expected:
00089             self.assertRaises(TypeError, hash, obj)

Here is the call graph for this function:

Definition at line 82 of file test_hash.py.

00082 
00083     def test_fixed_hash(self):
00084         for obj in self.fixed_expected:
00085             self.assertEqual(hash(obj), _FIXED_HASH_VALUE)

Here is the call graph for this function:

Definition at line 90 of file test_hash.py.

00090 
00091     def test_hashable(self):
00092         objects = (self.default_expected +
00093                    self.fixed_expected)
00094         for obj in objects:
00095             self.assertIsInstance(obj, Hashable)

Here is the call graph for this function:

Definition at line 96 of file test_hash.py.

00096 
00097     def test_not_hashable(self):
00098         for obj in self.error_expected:
00099             self.assertNotIsInstance(obj, Hashable)
00100 
00101 
# Issue #4701: Check that some builtin types are correctly hashable

Here is the call graph for this function:


Member Data Documentation

Initial value:
[object(),
                        DefaultHash(),
                        OnlyInequality(),
                       ]

Definition at line 66 of file test_hash.py.

Initial value:
[NoHash(),
                      OnlyEquality(),
                      ]

Definition at line 74 of file test_hash.py.

Initial value:
[FixedHash(),
                      InheritedHashWithEquality(),
                      InheritedHashWithInequality(),
                      ]

Definition at line 70 of file test_hash.py.


The documentation for this class was generated from the following file: