def test_lookupDays(self): tm = TimeMap() with self.assertRaises(ValueError): tm.lookupDays( 0 ) tm[0] = datetime.date(2000,1,1) tm[1] = datetime.date(2000,1,2) tm[2] = datetime.date(2000,1,3) self.assertEqual( 0 , tm.lookupDays( 0 )) self.assertEqual( 1 , tm.lookupDays( 1 )) self.assertEqual( 2 , tm.lookupDays( 2 )) with self.assertRaises(ValueError): tm.lookupDays( -1 ) with self.assertRaises(ValueError): tm.lookupDays( 0.50 ) with self.assertRaises(ValueError): tm.lookupDays( 3 )