Exemplo n.º 1
0
 def setDiscipline(self, new_disc):
     '''
     Checks if the new discipline is a string and sets it, otherwise it does nothing
     
     Parameters:
     new_disc - discipline
     '''
     if Utility.isString(new_disc) == True:
         self._discipline = new_disc
     else:
         return False
Exemplo n.º 2
0
 def setTeacher(self, new_teach):
     '''
     Checks it the teacher's name is a string and sets it, otherwise it does nothing
     
     Parameters:
     new_teach - name of the teacher
     '''
     if Utility.isString(new_teach):
         self._teacher = new_teach
     else:
         return False
Exemplo n.º 3
0
 def _test_utility_isString(self):
     '''
     Tests if detecting a string works
     '''
     assert Utility.isString("john") == True
     assert Utility.isString(1) == False
     assert Utility.isString("") == True
     assert Utility.isString(" a ") == True
     assert Utility.isString([]) == False
     assert Utility.isString(7.5) == False
     assert Utility.isString(True) == False