from random import randint from uuid import UUID from backend.model.student import Student from backend.model.tribe import Tribe from tests.model.fakes import build_assessments, build_tribes def test_init_student(): tribe = build_tribes(1)[0] student = Student(name="Bob", tribe=tribe) print(student) assert type(student.name) == str assert type(student.tribe) == Tribe assert type(student.id) == str student2 = Student(name="Hop", tribe=tribe) assert student.id != student2.id def test_tribe_register_assessment(): assessments_qty = randint(1, 10) tribes = build_tribes(1) assessments = build_assessments(tribes, assessments_qty) assert len(tribes[0].assessments) == assessments_qty assert tribes[0].assessments == assessments def test_tribe_register_student(): tribe = Tribe("foo", "2nd") student = Student(id="1", name="Bob", tribe=tribe) assert len(tribe.students) == 1 assert tribe.students[0] == student