def test_estEnCours(self): p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) pp = Placement("ID", p2, c, "date..", None) self.assertEqual(pp.estEnCours, True)
def test_recupererVehicule(self): v1 = Voiture() c1 = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, v1, 12363663, 144, "12/12/1212", None, "W9V69Q27") p2 = Place(1, 300, 200, 500, 778) self.assertEqual(c1.recupererVehicule(), False) Placement(None, p2, c1, "date..", None) self.assertEqual(c1.recupererVehicule(), True)
def test_effectuerTache(self): p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) pp = Placement("ID", p2, c, "date..", None) s = Service(pp, None, 1, "Livraison") s.effectuerTache() self.assertNotEqual(s.dateF, None)
def test_get(self): Placement.tous = [] p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) pp = Placement("ID", p2, c, "date..", None) self.assertEqual(Placement.get("ID"), pp) self.assertNotEqual(Placement.get("IDD"), pp)
def test_getServices(self): p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) pp = Placement("ID", p2, c, "date..", None) s1 = Service(pp, "26/10/2015", 1, "Livraison") s2 = Service(pp, "28/10/2015", 2, "Livraison 2") self.assertEqual(pp.getServices(), [s1, s2])
def test_nbPlaceOccupes(self): Placement.tous = [] self.assertEqual(Placement.nbPlaceOccupes(), 0) p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) Placement("ID", p2, c, "date..", None) self.assertEqual(Placement.nbPlaceOccupes(), 1)
def test_creerService(self): p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) pp = Placement("ID", p2, c, "date..", None) s = Service(pp, "26/10/2015", 1, "Livraison") self.assertEqual(s.dateF, "26/10/2015") self.assertEqual(s.argument, "Livraison") self.assertEqual(s.placement, pp) self.assertEqual(s.typeService, 1)
def test_create(self): v1 = Voiture() c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, v1, 12363663, 144, "12/12/1212", None) self.assertEqual(c.nom, "PEREIRA") self.assertEqual(c.prenom, "Alexandre") self.assertEqual(c.adr, "4 Boulevard Koenings 31300 Toulouse") self.assertEqual(c.placeReserve, None) self.assertEqual(c.cryptoVisuel, 144) self.assertEqual(c.dateExpiration, "12/12/1212") self.assertEqual(c.estAbonne, True) self.assertEqual(c.numCB, 12363663) self.assertEqual(c.voiture, v1)
def test_isAvailable(self): p = Place(1, 300, 200, 500, 777) self.assertEqual(p.isAvailable(), True) # la place a été réservé c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p, None) self.assertEqual(p.isAvailable(), False) p2 = Place(1, 300, 200, 500, 778) Placement(None, p2, c, "date..", None) self.assertEqual(p2.isAvailable(), False)
def test_creer(self): p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) pp = Placement("ID", p2, c, "date..", None) self.assertEqual(pp.client, c) self.assertEqual(pp.dateD, "date..") self.assertEqual(pp.dateF, None) self.assertEqual(pp.id, "ID") self.assertEqual(pp.place, p2) self.assertEqual(pp.services, [])
def test_getAvailablePlace(self): Place.tous = [] p2 = Place(1, 300, 200, 500, 788) c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", p2, None) Placement(None, p2, c, "date..", None) self.assertEqual(p2.isAvailable(), False) v = Voiture("IMMAT", 100, 200, 40) self.assertEqual(Place.getAvailablePlace(v), None) p2 = Place(1, 300, 200, 500, 788) self.assertNotEqual(Place.getAvailablePlace(v), None) self.assertEqual(Place.getAvailablePlace(v), p2)
def test_getNbAbonne(self): Client.tous = [] self.assertEqual(Client.getNbAbonne(), 0) Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, Voiture(), 12363663, 144, "12/12/1212", None, "W9V69Q27") self.assertEqual(Client.getNbAbonne(), 1)
def test_get(self): v1 = Voiture() c = Client("PEREIRA", "Alexandre", "4 Boulevard Koenings 31300 Toulouse", True, v1, 12363663, 144, "12/12/1212", None, "W9V69Q27") self.assertEqual(c.num, "W9V69Q27")