コード例 #1
0
 def test_removeStudent(self):
     repo = repoStudent()
     student1 = (1, "Keke")
     student2 = (2, "Mimi")
     repo.storeStudent(student1)
     repo.storeStudent(student2)
     repo.removeStudent(1)
     assert repo.getAll() == [student2]
コード例 #2
0
 def test_searchById(self):
     repo = repoStudent()
     student1 = (1, "Keke")
     student2 = (2, "Mimi")
     repo.storeStudent(student1)
     repo.storeStudent(student2)
     rez = repo.searchById(1)
     assert rez == student1
コード例 #3
0
 def test_getAll(self):
     repo = repoStudent()
     student1 = (1, "Keke")
     student2 = (2, "Mimi")
     repo.storeStudent(student1)
     repo.storeStudent(student2)
     aux = repo.getAll()
     assert aux == [student1, student2]
コード例 #4
0
 def test_storeStudent(self):
     repo = repoStudent()
     student1 = (1, "Coco")
     repo.storeStudent(student1)
     assert len(repo.getAll()) == 1
     student2 = (2, "Mojojojo")
     repo.storeStudent(student2)
     assert repo.getAll() == [student1, student2]
コード例 #5
0
 def test_convertList(self):
     repo = repoStudent()
     student1 = (1, "Keke")
     student2 = (2, "Mimi")
     repo.storeStudent(student1)
     repo.storeStudent(student2)
     auxList = [1]
     repo.convertList(auxList)
     assert auxList["Keke"]
コード例 #6
0
 def __init__(self, filename):
     self.__repo = repoStudent()
     self.__filename = filename.strip()
     self.__readAllFromFile()
コード例 #7
0
from Persistance.Repositories import repoGrade, repoStudent, repoDiscipline, Undo_Repository
from Persistance.FileRepo import repoStudentFile
from UI.Console import Console
from analyse.file import mode

import random
from random import randint
from test.sortperf import randfloats
from _stat import filemode

f = mode()
type = f.read_file()

if type[0] == "memory" :
    repoDiscipline = repoDiscipline()
    repoStudent = repoStudent()
    repoGrade = repoGrade()
else:
    repoStudent = repoStudentFile(type[1])
    repoDiscipline = repoDiscipline()
    repoGrade = repoGrade()
    # repoDiscipline = repoDisciplineFile()
    # repoGrade = repoGradeFile()
    
'''

repoDiscipline = repoDiscipline()
repoStudent = repoStudent()
repoGrade = repoGrade()

'''