Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_heapq.TestErrorHandlingPython Class Reference
Inheritance diagram for test.test_heapq.TestErrorHandlingPython:
Inheritance graph
Collaboration diagram for test.test_heapq.TestErrorHandlingPython:
Collaboration graph

List of all members.

Public Member Functions

def test_non_sequence
def test_len_only
def test_get_only
def test_get_only
def test_arg_parsing
def test_iterable_args

Static Public Attributes

 module = py_heapq

Detailed Description

Definition at line 374 of file

Member Function Documentation

Definition at line 357 of file

00358     def test_arg_parsing(self):
00359         for f in (self.module.heapify, self.module.heappop,
00360                   self.module.heappush, self.module.heapreplace,
00361                   self.module.nlargest, self.module.nsmallest):
00362             self.assertRaises((TypeError, AttributeError), f, 10)

Here is the call graph for this function:

Definition at line 340 of file

00341     def test_get_only(self):
00342         for f in (self.module.heapify, self.module.heappop):
00343             self.assertRaises(TypeError, f, GetOnly())
00344         for f in (self.module.heappush, self.module.heapreplace):
00345             self.assertRaises(TypeError, f, GetOnly(), 10)
00346         for f in (self.module.nlargest, self.module.nsmallest):
00347             self.assertRaises(TypeError, f, 2, GetOnly())

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 348 of file

00349     def test_get_only(self):
00350         seq = [CmpErr(), CmpErr(), CmpErr()]
00351         for f in (self.module.heapify, self.module.heappop):
00352             self.assertRaises(ZeroDivisionError, f, seq)
00353         for f in (self.module.heappush, self.module.heapreplace):
00354             self.assertRaises(ZeroDivisionError, f, seq, 10)
00355         for f in (self.module.nlargest, self.module.nsmallest):
00356             self.assertRaises(ZeroDivisionError, f, 2, seq)

Here is the call graph for this function:

Definition at line 363 of file

00364     def test_iterable_args(self):
00365         for f in (self.module.nlargest, self.module.nsmallest):
00366             for s in ("123", "", range(1000), (1, 1.2), range(2000,2200,5)):
00367                 for g in (G, I, Ig, L, R):
00368                     self.assertEqual(list(f(2, g(s))), list(f(2,s)))
00369                 self.assertEqual(list(f(2, S(s))), [])
00370                 self.assertRaises(TypeError, f, 2, X(s))
00371                 self.assertRaises(TypeError, f, 2, N(s))
00372                 self.assertRaises(ZeroDivisionError, f, 2, E(s))

Here is the call graph for this function:

Definition at line 332 of file

00333     def test_len_only(self):
00334         for f in (self.module.heapify, self.module.heappop):
00335             self.assertRaises((TypeError, AttributeError), f, LenOnly())
00336         for f in (self.module.heappush, self.module.heapreplace):
00337             self.assertRaises((TypeError, AttributeError), f, LenOnly(), 10)
00338         for f in (self.module.nlargest, self.module.nsmallest):
00339             self.assertRaises(TypeError, f, 2, LenOnly())

Here is the call graph for this function:

Definition at line 325 of file

00326     def test_non_sequence(self):
00327         for f in (self.module.heapify, self.module.heappop):
00328             self.assertRaises((TypeError, AttributeError), f, 10)
00329         for f in (self.module.heappush, self.module.heapreplace,
00330                   self.module.nlargest, self.module.nsmallest):
00331             self.assertRaises((TypeError, AttributeError), f, 10, 10)

Here is the call graph for this function:

Member Data Documentation

Reimplemented from test.test_heapq.TestErrorHandling.

Definition at line 375 of file

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