lol
This commit is contained in:
parent
506e2e65b9
commit
40b5f10822
43
src/m/test/TestAbonnement.py
Normal file
43
src/m/test/TestAbonnement.py
Normal file
@ -0,0 +1,43 @@
|
||||
"""
|
||||
Test Module Abonnement
|
||||
"""
|
||||
|
||||
|
||||
from src.m.Abonnement import Client, TypeAbonnement
|
||||
from nose.tools import assert_equal,assert_not_equal
|
||||
|
||||
## Test Client
|
||||
class TestClient:
|
||||
## Test Instenciations
|
||||
def TestClient(self):
|
||||
c = Client(None,"Jean","Paul","1225233",TypeAbonnement.ABONNE)
|
||||
id = c.id
|
||||
assert_equal(c.nom,"Jean")
|
||||
assert_equal(c.prenom,"Paul")
|
||||
assert_equal(c.cb,"1225233")
|
||||
assert_equal(c.abonnement,TypeAbonnement.ABONNE)
|
||||
|
||||
c = Client(id)
|
||||
assert_equal(c.nom,"Jean")
|
||||
assert_equal(c.prenom,"Paul")
|
||||
assert_equal(c.cb,"1225233")
|
||||
assert_equal(c.abonnement,TypeAbonnement.ABONNE)
|
||||
|
||||
## Test mise a jour Client
|
||||
def TestMaj(self):
|
||||
c = Client(None,"Jean","Paul","1225233",TypeAbonnement.ABONNE)
|
||||
c.maj("lulu","ez","45646",TypeAbonnement.SUPER_ABONNE)
|
||||
assert_equal(c.nom,"lulu")
|
||||
assert_equal(c.prenom,"ez")
|
||||
assert_equal(c.cb,"45646")
|
||||
assert_equal(c.abonnement,TypeAbonnement.SUPER_ABONNE)
|
||||
|
||||
## Test desabonnement
|
||||
def TestDesabo(self):
|
||||
c = Client(None,"Jean","Paul","1225233",TypeAbonnement.ABONNE)
|
||||
c.desabo()
|
||||
try :
|
||||
Client(c.id)
|
||||
assert_equal(False,True)
|
||||
except IndexError :
|
||||
pass
|
@ -1,6 +0,0 @@
|
||||
__author__ = 'sidya'
|
||||
|
||||
|
||||
class TestClient:
|
||||
def TestClient(self):
|
||||
pass
|
@ -1,11 +1,14 @@
|
||||
__author__ = 'sidya'
|
||||
|
||||
from nose.tools import assert_equal
|
||||
"""
|
||||
Test du du Module m/Parking
|
||||
"""
|
||||
from src.m.Voiture import Voiture
|
||||
from nose.tools import assert_equal,assert_not_equal
|
||||
|
||||
from src.m.Parking import Parking, TypePlace, Place
|
||||
|
||||
|
||||
## Test Parking
|
||||
class TestParking:
|
||||
## Test Instenciation
|
||||
def TestParking(self):
|
||||
p = Parking(None, "test", [TypePlace(None, 220, 200, 4, 2.5, 1), TypePlace(None, 200, 130, 5, 2.5, 1)])
|
||||
id = p.id
|
||||
@ -14,16 +17,34 @@ class TestParking:
|
||||
assert_equal(p.nbSuperAbo, 0, "Nombre de place super abo")
|
||||
|
||||
def TestRecherchePlace(self):
|
||||
pass
|
||||
p = Parking(None, "test", [TypePlace(None, 220, 200, 4, 2.5, 1)])
|
||||
|
||||
v = Voiture(None,None,300,300)
|
||||
place = p.recherchePlace(v)
|
||||
assert_equal(place, None, "Aucune place devrait etre trouve")
|
||||
|
||||
v = Voiture(None,None,100,300)
|
||||
place = p.recherchePlace(v)
|
||||
assert_equal(place, None, "Aucune place devrait etre trouve")
|
||||
|
||||
v = Voiture(None,None,300,100)
|
||||
place = p.recherchePlace(v)
|
||||
assert_equal(place, None, "Aucune place devrait estre trouve")
|
||||
|
||||
v = Voiture(None,None,100,100)
|
||||
place = p.recherchePlace(v)
|
||||
assert_not_equal(place, None, "Une place devrait etre trouve")
|
||||
|
||||
## Test Place
|
||||
class TestPlace:
|
||||
## Test intanciation
|
||||
def TestPlace(self):
|
||||
t1 = TypePlace(None, 220, 200, 4, 2.5, 1)
|
||||
parking = Parking(None, "test", [t1])
|
||||
|
||||
p = Place(None, parking, t1, 2, 1)
|
||||
|
||||
## Test de pendre et liberer les places
|
||||
def TestPrendreLiberer(self):
|
||||
t1 = TypePlace(None, 220, 200, 4, 2.5, 1)
|
||||
parking = Parking(None, "test", [t1])
|
||||
@ -50,8 +71,9 @@ class TestPlace:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
## Test Types Places
|
||||
class TestTypePlace:
|
||||
## Test Istanciation
|
||||
def TestTypePlace(self):
|
||||
# Creation
|
||||
t = TypePlace(None, 220, 200, 4, 2.5, 1)
|
||||
|
@ -1,6 +1,15 @@
|
||||
__author__ = 'sidya'
|
||||
"""
|
||||
Test Module m/Service
|
||||
"""
|
||||
from src.m.Abonnement import Client, TypeAbonnement
|
||||
from src.m.Parking import Placement
|
||||
|
||||
from src.m.Service import Service, TypeService
|
||||
|
||||
## Test des Service
|
||||
class TestService:
|
||||
## Test instanciation
|
||||
def TestService(self):
|
||||
pass
|
||||
#c = Client(None,"Jean","Paul","1225233",TypeAbonnement.ABONNE)
|
||||
#Service(None,c ,Placement(),TypeService.ENTRETIEN)
|
@ -1,15 +1,17 @@
|
||||
"""
|
||||
Test Module m/Voiture
|
||||
"""
|
||||
|
||||
from src.m.Voiture import Voiture
|
||||
|
||||
__author__ = 'sidya'
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
|
||||
## Test Voiture
|
||||
class TestVoiture:
|
||||
## Test instanciation
|
||||
def TestVoiture(self):
|
||||
v = Voiture(None, None, 120, 100, "IMMA")
|
||||
assert_equal(v.longueur, 120, "Ne retourne pas la longueur attendue")
|
||||
assert_equal(v.hauteur, 100, "Ne retourne pas la hateur attendue")
|
||||
assert_equal(v.hauteur, 100, "Ne retourne pas la hauteur attendue")
|
||||
assert_equal(v.immatriculation, "IMMA", "Ne retourne pas l'immatriculation attendue")
|
||||
id = v.id
|
||||
|
||||
|
@ -28,7 +28,7 @@ class Ui_Borne(object):
|
||||
self.btn_Voiture.setGeometry(QtCore.QRect(30, 40, 211, 27))
|
||||
self.btn_Voiture.setObjectName(_fromUtf8("btn_Voiture"))
|
||||
self.nomParking = QtGui.QLabel(Borne)
|
||||
self.nomParking.setGeometry(QtCore.QRect(10, 10, 791, 20))
|
||||
self.nomParking.setGeometry(QtCore.QRect(10, 0, 791, 41))
|
||||
self.nomParking.setObjectName(_fromUtf8("nomParking"))
|
||||
self.box_id = QtGui.QGroupBox(Borne)
|
||||
self.box_id.setGeometry(QtCore.QRect(20, 150, 331, 171))
|
||||
@ -131,7 +131,7 @@ class Ui_Borne(object):
|
||||
self.dateTimeEdit.setGeometry(QtCore.QRect(320, 30, 121, 23))
|
||||
self.dateTimeEdit.setObjectName(_fromUtf8("dateTimeEdit"))
|
||||
self.layoutWidget_2 = QtGui.QWidget(self.box_service)
|
||||
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 20, 109, 121))
|
||||
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 20, 112, 121))
|
||||
self.layoutWidget_2.setObjectName(_fromUtf8("layoutWidget_2"))
|
||||
self.verticalLayout_4 = QtGui.QVBoxLayout(self.layoutWidget_2)
|
||||
self.verticalLayout_4.setMargin(0)
|
||||
@ -192,8 +192,7 @@ class Ui_Borne(object):
|
||||
def retranslateUi(self, Borne):
|
||||
Borne.setWindowTitle(_translate("Borne", "Borne", None))
|
||||
self.btn_Voiture.setText(_translate("Borne", "Detection Arrivee Voiture", None))
|
||||
self.nomParking.setText(
|
||||
_translate("Borne", "<html><head/><body><p align=\"center\">NomParking</p></body></html>", None))
|
||||
self.nomParking.setText(_translate("Borne", "<html><head/><body><p align=\"center\">NomParking</p></body></html>", None))
|
||||
self.box_id.setTitle(_translate("Borne", "Identification", None))
|
||||
self.label.setText(_translate("Borne", "Carte Membre ID ", None))
|
||||
self.btn_validerID.setText(_translate("Borne", "Valider", None))
|
||||
@ -209,8 +208,7 @@ class Ui_Borne(object):
|
||||
self.numeroTicketLabel.setText(_translate("Borne", "Numero Ticket :", None))
|
||||
self.btn_recuperer.setText(_translate("Borne", "Récupérer Véhicule", None))
|
||||
self.pushButton.setText(_translate("Borne", "Payer", None))
|
||||
self.label_aff.setText(
|
||||
_translate("Borne", "<html><head/><body><p align=\"center\">TextLabel</p></body></html>", None))
|
||||
self.label_aff.setText(_translate("Borne", "<html><head/><body><p align=\"center\">TextLabel</p></body></html>", None))
|
||||
self.box_garer.setTitle(_translate("Borne", "Se garer", None))
|
||||
self.btn_garer.setText(_translate("Borne", "Garer Véhicule", None))
|
||||
self.box_service.setTitle(_translate("Borne", "Service (Abonnée seulement)", None))
|
||||
|
10
ui/borne.py
10
ui/borne.py
@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'borne.ui'
|
||||
#
|
||||
# Created: Sun Feb 1 14:38:43 2015
|
||||
# Created: Sun Feb 8 11:36:37 2015
|
||||
# by: PyQt4 UI code generator 4.11.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -31,7 +31,7 @@ class Ui_Borne(object):
|
||||
self.btn_Voiture.setGeometry(QtCore.QRect(30, 40, 211, 27))
|
||||
self.btn_Voiture.setObjectName(_fromUtf8("btn_Voiture"))
|
||||
self.nomParking = QtGui.QLabel(Borne)
|
||||
self.nomParking.setGeometry(QtCore.QRect(10, 10, 791, 20))
|
||||
self.nomParking.setGeometry(QtCore.QRect(10, 0, 791, 41))
|
||||
self.nomParking.setObjectName(_fromUtf8("nomParking"))
|
||||
self.box_id = QtGui.QGroupBox(Borne)
|
||||
self.box_id.setGeometry(QtCore.QRect(20, 150, 331, 171))
|
||||
@ -134,7 +134,7 @@ class Ui_Borne(object):
|
||||
self.dateTimeEdit.setGeometry(QtCore.QRect(320, 30, 121, 23))
|
||||
self.dateTimeEdit.setObjectName(_fromUtf8("dateTimeEdit"))
|
||||
self.layoutWidget_2 = QtGui.QWidget(self.box_service)
|
||||
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 20, 109, 121))
|
||||
self.layoutWidget_2.setGeometry(QtCore.QRect(20, 20, 112, 121))
|
||||
self.layoutWidget_2.setObjectName(_fromUtf8("layoutWidget_2"))
|
||||
self.verticalLayout_4 = QtGui.QVBoxLayout(self.layoutWidget_2)
|
||||
self.verticalLayout_4.setMargin(0)
|
||||
@ -191,10 +191,6 @@ class Ui_Borne(object):
|
||||
Borne.setTabOrder(self.numeroTicketLineEdit, self.btn_recuperer)
|
||||
Borne.setTabOrder(self.btn_recuperer, self.pushButton)
|
||||
Borne.setTabOrder(self.pushButton, self.btn_quitter)
|
||||
Borne.setTabOrder(self.btn_quitter, Borne.checkBox_Livraison)
|
||||
Borne.setTabOrder(Borne.checkBox_Livraison, Borne.checkBox_Maintenance)
|
||||
Borne.setTabOrder(Borne.checkBox_Maintenance, Borne.checkBox_Entretien)
|
||||
Borne.setTabOrder(Borne.checkBox_Entretien, Borne.lieuLineEdit)
|
||||
|
||||
def retranslateUi(self, Borne):
|
||||
Borne.setWindowTitle(_translate("Borne", "Borne", None))
|
||||
|
10
ui/borne.ui
10
ui/borne.ui
@ -30,9 +30,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>10</y>
|
||||
<y>0</y>
|
||||
<width>791</width>
|
||||
<height>20</height>
|
||||
<height>41</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
@ -318,7 +318,7 @@
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>109</width>
|
||||
<width>112</width>
|
||||
<height>121</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -430,10 +430,6 @@
|
||||
<tabstop>btn_recuperer</tabstop>
|
||||
<tabstop>pushButton</tabstop>
|
||||
<tabstop>btn_quitter</tabstop>
|
||||
<tabstop>checkBox_Livraison</tabstop>
|
||||
<tabstop>checkBox_Maintenance</tabstop>
|
||||
<tabstop>checkBox_Entretien</tabstop>
|
||||
<tabstop>lieuLineEdit</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
Reference in New Issue
Block a user