Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
test.test_index.OverflowTestCase Class Reference

List of all members.

Public Member Functions

def setUp
def test_large_longs
def test_getitem
def test_sequence_repeat

Public Attributes

 pos
 neg

Detailed Description

Definition at line 211 of file test_index.py.


Member Function Documentation

Definition at line 213 of file test_index.py.

00213 
00214     def setUp(self):
00215         self.pos = 2**100
00216         self.neg = -self.pos

Here is the caller graph for this function:

Definition at line 221 of file test_index.py.

00221 
00222     def test_getitem(self):
00223         class GetItem:
00224             def __len__(self):
00225                 assert False, "__len__ should not be invoked"
00226             def __getitem__(self, key):
00227                 return key
00228         x = GetItem()
00229         self.assertEqual(x[self.pos], self.pos)
00230         self.assertEqual(x[self.neg], self.neg)
00231         self.assertEqual(x[self.neg:self.pos].indices(maxsize),
00232                          (0, maxsize, 1))
00233         self.assertEqual(x[self.neg:self.pos:1].indices(maxsize),
00234                          (0, maxsize, 1))

Here is the call graph for this function:

Definition at line 217 of file test_index.py.

00217 
00218     def test_large_longs(self):
00219         self.assertEqual(self.pos.__index__(), self.pos)
00220         self.assertEqual(self.neg.__index__(), self.neg)

Here is the call graph for this function:

Definition at line 235 of file test_index.py.

00235 
00236     def test_sequence_repeat(self):
00237         self.assertRaises(OverflowError, lambda: "a" * self.pos)
00238         self.assertRaises(OverflowError, lambda: "a" * self.neg)
00239 

Here is the call graph for this function:


Member Data Documentation

Definition at line 215 of file test_index.py.

Definition at line 214 of file test_index.py.


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