Example #1
0
def testeChoixCouleur():
    fonctionnel = True
    chiffre = 1
    cleInconnu = "abcdfz"
    liste = [1]
    couleurFonctionnel = "cyan"
    try:
        Tron.ChoixCouleur(chiffre)
    except KeyError:
        print("Fonctionnel")
    else:
        print("La fonction ChoixCouleur accepte les chiffres")
        fonctionnel = False
    try:
        Tron.ChoixCouleur(cleInconnu)
    except KeyError:
        print("Fonctionnel")
    else:
        print("La fonction ChoixCouleur accepte une clé inconnu")
        fonctionnel = False
    try:
        Tron.ChoixCouleur(liste)
    except TypeError:
        print("Fonctionnel")
    else:
        print("La fonction ChoixCouleur accepte les listes.")
        fonctionnel = False
    if fonctionnel:
        try:
            Tron.ChoixCouleur(couleurFonctionnel)
        except KeyError:
            print("La fonction ChoixCouleur ne fonctionne pas.")
        else:
            print("La fonction ChoixCouleur fonctionne entièrement.")