[test] Soyons fin sur --fast, cf a620f5b5e9

This commit is contained in:
Valentin Samir 2013-05-21 15:48:12 +02:00
parent 22f8d63c0e
commit 8f4a7df242

48
test.py
View file

@ -141,32 +141,34 @@ print u"Tests effectués avec les droits %s " % ', '.join(conn.droits)
# les adhérents et de toutes les machines # # les adhérents et de toutes les machines #
############################################### ###############################################
if not fast_test: anim("Appel de allMachinesAdherents en %s" % ('ro' if fast_test else 'rw'))
anim("Appel de allMachinesAdherents en rw") try:
try: if fast_test:
machines, adherents = conn.allMachinesAdherents(mode='rw')
except EnvironmentError as error:
print ERREUR
if show_traceback: print traceback.format_exc()
else: print "\t%s" % error
exit(1)
except Exception as error:
print ERREUR
if show_traceback: print traceback.format_exc()
else: print "\t%r" % error
anim("Fallback en ro")
machines, adherents = conn.allMachinesAdherents() machines, adherents = conn.allMachinesAdherents()
print OK
else: else:
print OK machines, adherents = conn.allMachinesAdherents(mode='rw')
except EnvironmentError as error:
print ERREUR
if show_traceback: print traceback.format_exc()
else: print "\t%s" % error
exit(1)
except Exception as error:
print ERREUR
if show_traceback: print traceback.format_exc()
else: print "\t%r" % error
anim("Fallback en ro")
machines, adherents = conn.allMachinesAdherents()
print OK
else:
print OK
machines_attrs_keys = keys_of_list_of_dict(machines, 'machines') machines_attrs_keys = keys_of_list_of_dict(machines, 'machines')
print "Test des attributs des machines" print "Test des attributs des machines"
test_list_of_dict(machines_attrs_keys, machines) test_list_of_dict(machines_attrs_keys, machines)
adherents_attrs_keys = keys_of_list_of_dict(adherents, 'adherents') adherents_attrs_keys = keys_of_list_of_dict(adherents, 'adherents')
print "Test des attributs des adhérents" print "Test des attributs des adhérents"
test_list_of_dict(adherents_attrs_keys, adherents) test_list_of_dict(adherents_attrs_keys, adherents)
print "Test de création d'objets" print "Test de création d'objets"