def test_term_validate_term_raises_exception_if_argument_not_of_list_type( self): test_list = (1, True, 3) exc = None try: Term.validate_term(test_list) except Exception as err: exc = err self.assertIsNotNone(exc) self.assertEqual(str(exc), 'Argument must be of "list" type.')
def test_term_validate_term_raises_exception_if_length_of_list_is_not_three( self): test_list = [1, True, 3, 5] exc = None try: Term.validate_term(test_list) except Exception as err: exc = err self.assertIsNotNone(exc) self.assertEqual(str(exc), 'List must contain 3 elements.')
def test_term_validate_term_raises_exception_if_third_elem_of_list_not_int_or_none( self): test_list = [1, True, '3'] exc = None try: Term.validate_term(test_list) except Exception as err: exc = err self.assertIsNotNone(exc) self.assertEqual( str(exc), 'Third element of list must be of "int" type or None.')
def test_term_validate_term_raises_exception_if_second_elem_of_list_not_bool_or_none( self): test_list = [1, 'False', 3] exc = None try: Term.validate_term(test_list) except Exception as err: exc = err self.assertIsNotNone(exc) self.assertEqual(str(exc), 'Second element of list must be of "bool" type.')
def test_term_validate_term_passes_with_correct_input(self): test_list = [1, True, 3] Term.validate_term(test_list)