Exemplo n.º 1
0
 def test_add(self):
     student = home2_2.Student(home2_2.Person())
     teacher = home2_2.Teacher(home2_2.Person())
     classroom = home2_2.ClassRoom([student, student])
     school = home2_2.School()
     self.assertEqual(school.add_techer(teacher), True)
     self.assertEqual(len(school.teachers), 1)
     self.assertEqual(school.add_class(classroom), True)
     self.assertEqual(len(school.classrooms), 1)
     self.assertEqual(school.add_class(teacher), False)
Exemplo n.º 2
0
 def test_get_lesons_count(self):
     schedule = home2_2.Schedule(
         home2_2.Leson("axqwcc", home2_2.Teacher(home2_2.Person()), "math"),
         datetime.date.today(), 105)
     student = home2_2.Student(home2_2.Person())
     schedule.set_absent(student)
     schedules = home2_2.Schedules()
     schedules.add_schedule(schedule)
     self.assertEqual(schedules.get_lesons_count(datetime.date.today()), 1)
     self.assertEqual(
         len(schedules.get_absents(datetime.date.today(), "math")), 1)
Exemplo n.º 3
0
 def test_init(self):
     student = home2_2.Student(home2_2.Person())
     classroom = home2_2.ClassRoom(student)
     self.assertEqual(len(classroom.studentList), 0)
     classroom = home2_2.ClassRoom([student])
     self.assertEqual(len(classroom.studentList), 1)
Exemplo n.º 4
0
 def test__init(self):
     student = home2_2.Student(home2_2.Person())
     self.assertIsInstance(student, home2_2.Student)
Exemplo n.º 5
0
 def test_addStudent(self):
     classroom = home2_2.ClassRoom()
     self.assertEqual(len(classroom.studentList), 0)
     classroom.addStudent(home2_2.Student(home2_2.Person()))
     self.assertEqual(len(classroom.studentList), 1)