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]
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
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]
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]
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"]
def __init__(self, filename): self.__repo = repoStudent() self.__filename = filename.strip() self.__readAllFromFile()
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() '''