Esempio n. 1
0
 def testEagerVickrey3(self):  
     bids =     [4.5, 2.3,   3, 0,  4, 5, 2]
     reserves = [ 10,   2, 3.1, 0, 10, 1, 6]
     expected = ([ 0,   0,   0, 0,  0, 1, 0],
                 [ 0,   0,   0, 0,  0,2.3,0])
     obtained = eagerVickrey(bids,reserves)
     #there is no almost equal method in unittest
     self.assertEqual(expected, obtained, "Expected " + str(expected) + " but obtained  " + str(obtained) )
Esempio n. 2
0
 def testEagerVickerey4(self):
     bids =     [10,2]
     reserves = [5, 1]
     expected = ([1,0],[5,0])
     obtained = eagerVickrey(bids,reserves)
     self.assertEqual(expected, obtained, "Expected " + str(expected) + " but obtained  " + str(obtained) )