Back to index

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

List of all members.

Public Member Functions

def test_vsBuiltinSort
def test_backcompatibility
def test_listDerived

Static Public Attributes

 module = None

Detailed Description

Definition at line 181 of file test_bisect.py.


Member Function Documentation

Definition at line 196 of file test_bisect.py.

00196 
00197     def test_backcompatibility(self):
00198         self.assertEqual(self.module.insort, self.module.insort_right)

Here is the call graph for this function:

Definition at line 199 of file test_bisect.py.

00199 
00200     def test_listDerived(self):
00201         class List(list):
00202             data = []
00203             def insert(self, index, item):
00204                 self.data.insert(index, item)
00205 
00206         lst = List()
00207         self.module.insort_left(lst, 10)
00208         self.module.insort_right(lst, 5)
00209         self.assertEqual([5, 10], lst.data)

Here is the call graph for this function:

def test.test_bisect.TestInsort.test_vsBuiltinSort (   self,
  n = 500 
)

Definition at line 184 of file test_bisect.py.

00184 
00185     def test_vsBuiltinSort(self, n=500):
00186         from random import choice
00187         for insorted in (list(), UserList()):
00188             for i in range(n):
00189                 digit = choice("0123456789")
00190                 if digit in "02468":
00191                     f = self.module.insort_left
00192                 else:
00193                     f = self.module.insort_right
00194                 f(insorted, digit)
00195         self.assertEqual(sorted(insorted), insorted)

Here is the call graph for this function:


Member Data Documentation

Reimplemented in test.test_bisect.TestInsortC, and test.test_bisect.TestInsortPython.

Definition at line 182 of file test_bisect.py.


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