Skip to content
Snippets Groups Projects
Select Git revision
  • f4152d9a9bdeabc94c8b98d3b62da0fcce8b59e5
  • master default protected
2 results

test_file.py

Blame
  • Forked from Vuillemot Romain / INF-TC1
    Source project has a limited visibility.
    test_tas.py 568 B
    from Tas import *
    
    if __name__=="__main__": 
            
        data = []
    
        with open("etudiants.txt") as f:
            keys = None
            for line in f:
                l = [w.strip() for w in line.split(';')]
                if keys is None:
                    keys = l
                else:
                    data.append({k:v for k, v in zip(keys, l)})
    
        tas = Tas()
    
        for d in data:
            tas.ajoute(int(d['moyenne']))
        
        r = tas.get_racine()
        fg, fg_i = tas.get_fils_gauche(0)
        ffg, ffg_i = tas.get_fils_droit(0)
    
        assert(r == 19 and fg == 14 and ffg == 16)