CMS 3D CMS Logo

List of all members | Public Member Functions
diclist_test.DiclistTestCase Class Reference
Inheritance diagram for diclist_test.DiclistTestCase:

Public Member Functions

def test_bad_int_key (self)
 
def test_float_key (self)
 
def test_string_key (self)
 

Detailed Description

Definition at line 6 of file diclist_test.py.

Member Function Documentation

def diclist_test.DiclistTestCase.test_bad_int_key (   self)

Definition at line 16 of file diclist_test.py.

16  def test_bad_int_key(self):
17  dl = diclist()
18  self.assertRaises(ValueError, dl.add, 1, 'a')
19  self.assertRaises(ValueError, dl.add, 1, 'a')
20 
def diclist_test.DiclistTestCase.test_float_key (   self)

Definition at line 21 of file diclist_test.py.

21  def test_float_key(self):
22  dl = diclist()
23  dl.add(1., 'a')
24  dl.add(2., 'b')
25  self.assertRaises(IndexError, dl.__getitem__, 2)
26  self.assertEqual(dl[2.], 'b')
27 
28 
def diclist_test.DiclistTestCase.test_string_key (   self)

Definition at line 8 of file diclist_test.py.

8  def test_string_key(self):
9  dl = diclist()
10  dl.add('a', 1)
11  dl.add('b', 2)
12  dl.add('c', 3)
13  self.assertEqual([1,2,3], [value for value in dl] )
14  self.assertEqual(dl['c'], 3)
15