Back to index

python3.2  3.2.2
Public Member Functions | Static Public Attributes
test.test_enumerate.TestStart Class Reference
Inheritance diagram for test.test_enumerate.TestStart:
Inheritance graph
[legend]
Collaboration diagram for test.test_enumerate.TestStart:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_basicfunction
def test_getitemseqn
def test_iteratorseqn
def test_iteratorgenerator
def test_noniterable
def test_illformediterable
def test_exception_propagation
def test_argumentcheck
def test_tuple_reuse

Static Public Attributes

tuple enum = lambdaself,i:enumerate(i, start=11)

Detailed Description

Definition at line 224 of file test_enumerate.py.


Member Function Documentation

Definition at line 100 of file test_enumerate.py.

00100 
00101     def test_argumentcheck(self):
00102         self.assertRaises(TypeError, self.enum) # no arguments
00103         self.assertRaises(TypeError, self.enum, 1) # wrong type (not iterable)
00104         self.assertRaises(TypeError, self.enum, 'abc', 'a') # wrong type
00105         self.assertRaises(TypeError, self.enum, 'abc', 2, 3) # too many arguments

Here is the call graph for this function:

Reimplemented from test.test_enumerate.EnumerateTestCase.

Definition at line 218 of file test_enumerate.py.

00218 
00219     def test_basicfunction(self):
00220         e = self.enum(self.seq)
00221         self.assertEqual(iter(e), e)
00222         self.assertEqual(list(self.enum(self.seq)), self.res)
00223 

Here is the call graph for this function:

Definition at line 97 of file test_enumerate.py.

00097 
00098     def test_exception_propagation(self):
00099         self.assertRaises(ZeroDivisionError, list, self.enum(E(self.seq)))

Here is the call graph for this function:

Definition at line 76 of file test_enumerate.py.

00076 
00077     def test_getitemseqn(self):
00078         self.assertEqual(list(self.enum(G(self.seq))), self.res)
00079         e = self.enum(G(''))
00080         self.assertRaises(StopIteration, next, e)

Here is the call graph for this function:

Definition at line 94 of file test_enumerate.py.

00094 
00095     def test_illformediterable(self):
00096         self.assertRaises(TypeError, self.enum, N(self.seq))

Here is the call graph for this function:

Definition at line 86 of file test_enumerate.py.

00086 
00087     def test_iteratorgenerator(self):
00088         self.assertEqual(list(self.enum(Ig(self.seq))), self.res)
00089         e = self.enum(Ig(''))
00090         self.assertRaises(StopIteration, next, e)

Here is the call graph for this function:

Definition at line 81 of file test_enumerate.py.

00081 
00082     def test_iteratorseqn(self):
00083         self.assertEqual(list(self.enum(I(self.seq))), self.res)
00084         e = self.enum(I(''))
00085         self.assertRaises(StopIteration, next, e)

Here is the call graph for this function:

Definition at line 91 of file test_enumerate.py.

00091 
00092     def test_noniterable(self):
00093         self.assertRaises(TypeError, self.enum, X(self.seq))

Here is the call graph for this function:

Definition at line 107 of file test_enumerate.py.

00107 
00108     def test_tuple_reuse(self):
00109         # Tests an implementation detail where tuple is reused
00110         # whenever nothing else holds a reference to it
00111         self.assertEqual(len(set(map(id, list(enumerate(self.seq))))), len(self.seq))
00112         self.assertEqual(len(set(map(id, enumerate(self.seq)))), min(1,len(self.seq)))

Here is the call graph for this function:


Member Data Documentation

tuple test.test_enumerate.TestStart.enum = lambdaself,i:enumerate(i, start=11) [static]

Reimplemented from test.test_enumerate.EnumerateTestCase.

Definition at line 226 of file test_enumerate.py.


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