Exemplo n.º 1
0
 def testFiveSpotsFiveReservation(self):  #Borde
     myParking = parking(5)
     myParking.addReservation("0900", "1800")
     myParking.addReservation("1000", "1800")
     myParking.addReservation("1200", "1800")
     myParking.addReservation("1000", "1800")
     self.assertTrue(myParking.addReservation("1000", "1800"))
Exemplo n.º 2
0
 def testFiveSpotsSixReservationNoOverlapping(self):  #esquina
     myParking = parking(5)
     myParking.addReservation("0900", "1800")
     myParking.addReservation("1000", "1800")
     myParking.addReservation("1200", "1800")
     myParking.addReservation("1200", "1800")
     myParking.addReservation("1000", "1800")
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0900", "1200"))
Exemplo n.º 3
0
 def testFiveSpotsSixReservation(self):  #borde
     myParking = parking(5)
     myParking.addReservation("0900", "1800")
     myParking.addReservation("1000", "1800")
     myParking.addReservation("1200", "1800")
     myParking.addReservation("1200", "1800")
     myParking.addReservation("1000", "1800")
     self.assertFalse(myParking.addReservation("1000", "1800"))
     self.assertFalse(myParking.addReservation("0900", "1500"))
Exemplo n.º 4
0
 def testAddTreeReservation(self):  #malicia
     myParking = parking(10)
     myParking.addReservation("0900", "1800")
     myParking.addReservation("1000", "1800")
     myParking.addReservation("1200", "1800")
     self.assertEqual(myParking.occupation, [(900, 1),
                                             (1800, -1), (1000, 1),
                                             (1800, -1), (1200, 1),
                                             (1800, -1)])
Exemplo n.º 5
0
 def testManyReservationsMaxOverlapping(self):  #malicia
     myParking = parking(10)
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0700", "1000"))
     self.assertTrue(myParking.addReservation("0800", "1000"))
     self.assertTrue(myParking.addReservation("0900", "1000"))
     self.assertTrue(myParking.addReservation("0700", "1100"))
     self.assertTrue(myParking.addReservation("0800", "1200"))
     self.assertTrue(myParking.addReservation("0900", "1300"))
     self.assertTrue(myParking.addReservation("0600", "0900"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
Exemplo n.º 6
0
 def testManyReservationsOneOverlap(self):  #malicia y esquinas
     myParking = parking(10)
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0700", "1000"))
     self.assertTrue(myParking.addReservation("0800", "1000"))
     self.assertTrue(myParking.addReservation("0900", "1000"))
     self.assertTrue(myParking.addReservation("0700", "1100"))
     self.assertTrue(myParking.addReservation("0800", "1200"))
     self.assertTrue(myParking.addReservation("0900", "1300"))
     self.assertTrue(myParking.addReservation("0600", "0900"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertFalse(myParking.addReservation("0900", "1000"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
Exemplo n.º 7
0
 def testNoMilitaryFormat(self):  #malicia
     myParking = parking(10)
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0700", "1000"))
     self.assertTrue(myParking.addReservation("0800", "1000"))
     self.assertTrue(myParking.addReservation("0900", "1000"))
     self.assertTrue(myParking.addReservation("0700", "1100"))
     self.assertTrue(myParking.addReservation("0800", "1200"))
     self.assertTrue(myParking.addReservation("0900", "1300"))
     self.assertTrue(myParking.addReservation("0600", "0900"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertTrue(myParking.addReservation("0600", "1000"))
     self.assertFalse(myParking.addReservation("0900", "1000"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
     self.assertTrue(myParking.addReservation("1000", "1500"))
Exemplo n.º 8
0
 def testNoAceptaAdd(self):  #malicia
     myParking = parking(10)
     msg = "no debe agregar"
     self.assertRaises(ValueError, myParking.addReservation, "0900", "0600")
Exemplo n.º 9
0
 def testTenSpotsOneReservation(self):  #malicia
     myParking = parking(10)
     self.assertTrue(myParking.addReservation("0900", "1500"))
Exemplo n.º 10
0
 def testNoSpotParking(self):  #borde
     myParking = parking(0)
     self.assertFalse(myParking.addReservation("0900", "1500"))
Exemplo n.º 11
0
 def testSameHOurInOut(self):
     myParking = parking(0)
     self.assertTrue(myParking.addReservation("0600", "0600"))
Exemplo n.º 12
0
 def testOneReservation(self):  #borde
     myParking = parking(1)
     self.assertTrue(myParking.addReservation("0900", "1500"))