Exemplo n.º 1
0
 def test_student_with_attributes(self):
     student = SchoolMemberFactory.make(kind="student",
                                        name="fer",
                                        age=23,
                                        id_num='002547')
     self.assertEqual(str(student),
                      "Soy fer!, tengo 23 años y mi ID = 002547")
Exemplo n.º 2
0
 def test_student_with_incorrect_lenght_id(self):
     student = SchoolMemberFactory.make(kind="student",
                                        name="fer",
                                        age=23,
                                        id_num='2547')
     self.assertEqual(str(student),
                      "Error! El tamaño del ID debe ser de 6 caracteres")
Exemplo n.º 3
0
 def test_student_attributes(self):
     student = SchoolMemberFactory.make("student",
                                        name="Simona",
                                        age=17,
                                        id_num="18316")
     self.assertEqual(
         str(student),
         "Soy el alumno Simona!, tengo 17 años y mi ID = 18316")
Exemplo n.º 4
0
 def test_visitor_creation(self):
     visitor = SchoolMemberFactory.make(kind="visitor", name="fer")
     self.assertEqual(str(visitor),
                      "Soy fer!, tengo -1 años y mi ID = XXXXXX")
Exemplo n.º 5
0
 def test_teacher_creation(self):
     teacher = SchoolMemberFactory.make(kind="teacher", name="bar")
     self.assertEqual(str(teacher),
                      "Soy bar!, tengo -1 años y mi ID = XXXXXX")
Exemplo n.º 6
0
 def test_invalid_with_multiple_case(self):
     with self.assertRaisesWithMessage(ValueError):
         SchoolMemberFactory.make("InVaLID", name="foo")
Exemplo n.º 7
0
 def test_invalid_type(self):
     with self.assertRaisesWithMessage(ValueError):
         SchoolMemberFactory.make("invalid", name="foo")
Exemplo n.º 8
0
 def test_invalid_with_multiple_case(self):
     invalid = SchoolMemberFactory.make("inVaLiD", name="bar")
     self.assertEqual(str(invalid), "Error! tipo 'inVaLiD' invalido!")
Exemplo n.º 9
0
 def test_invalid_with_multiple_case(self):
     invalid = SchoolMemberFactory.make(kind="inVaLiD", name="bar")
     self.assertEqual(str(invalid), "[Error]: 'inVaLiD' invalid kind")
Exemplo n.º 10
0
 def test_invalid_with_multiple_case(self):
     invalid = SchoolMemberFactory.make("inVaLiD", name="Oracle")
     self.assertEqual(
         str(invalid),
         "# ERROR # Esa fucion no es valida. intente: Student, Teacher, Coach."
     )
Exemplo n.º 11
0
 def test_invalid_type(self):
     invalid = SchoolMemberFactory.make("invalid", name="Joker")
     self.assertEqual(
         str(invalid),
         "# ERROR # Esa fucion no es valida. intente: Student, Teacher, Coach."
     )
Exemplo n.º 12
0
 def test_creation_with_multiple_case(self):
     teacher = SchoolMemberFactory.make("tEaCHer", name="Skull")
     self.assertEqual(
         str(teacher),
         "Soy el profesor Skull!, tengo 22 años y mi ID = 070KGP")
Exemplo n.º 13
0
 def test_coach_creation(self):
     coach = SchoolMemberFactory.make("coach", name="Noir")
     self.assertEqual(str(coach),
                      "Soy el Coach Noir!, tengo 22 años y mi ID = 070KGP")
Exemplo n.º 14
0
 def test_teacher_creation(self):
     teacher = SchoolMemberFactory.make("teacher", name="Crow")
     self.assertEqual(
         str(teacher),
         "Soy el profesor Crow!, tengo 22 años y mi ID = 070KGP")
Exemplo n.º 15
0
 def test_director_creation(self):
     director = SchoolMemberFactory.make("director", name="Simon")
     self.assertEqual(
         str(director),
         "Soy el director Simon!, tengo -1 años y mi ID = XXXXXX")
Exemplo n.º 16
0
 def test_creation_with_multiple_case(self):
     teacher = SchoolMemberFactory.make(kind="tEaCHer", name="baz")
     self.assertEqual(str(teacher),
                      "Soy baz!, tengo -1 años y mi ID = XXXXXX")
Exemplo n.º 17
0
 def test_invalid_type(self):
     invalid = SchoolMemberFactory.make(kind="invalid", name="foo")
     self.assertEqual(str(invalid), "[Error]: 'invalid' invalid kind")
Exemplo n.º 18
0
 def test_student_creation(self):
     student = SchoolMemberFactory.make("student", name="Panther")
     self.assertEqual(
         str(student),
         "Soy el estudiante Panther!, tengo 22 años y mi ID = 070KGP")
Exemplo n.º 19
0
 def test_janitor_creation(self):
     janitor = SchoolMemberFactory.make("Janitor", name="foo")
     self.assertEqual(
         str(janitor),
         "Soy el Janitor foo!, tengo -1 años y mi ID = XXXXXX")
Exemplo n.º 20
0
 def test_creation_no_name(self):
     teacher = SchoolMemberFactory.make("tEaCHer", age=22)
     self.assertEqual(str(teacher),
                      "Soy el Teacher !, tengo 22 años y mi ID = XXXXXX")
Exemplo n.º 21
0
 def test_student_creation(self):
     student = SchoolMemberFactory.make(kind="student", name="foo")
     self.assertEqual(str(student),
                      "Soy foo!, tengo -1 años y mi ID = XXXXXX")
Exemplo n.º 22
0
 def test_invalid_type(self):
     invalid = SchoolMemberFactory.make("invalid", name="foo")
     self.assertEqual(str(invalid), "Error! tipo 'invalid' invalido!")