Esempio n. 1
0
 def test_new_tour_date(self, new_date):
     eh = ErrorHandling()
     if eh.nonblank_string(new_date[0]) == False:
         failure_list = [False, "The address field must be filled."]
         return failure_list
     elif eh.nonblank_string(new_date[1]) == False:
         failure_list = [False, "The city field must be filled."]
         return failure_list
     elif eh.variable_length_checking(new_date[2], 2) == False:
         failure_list = [False, "The state field must be with a state abbreviation."]
         return failure_list
     elif eh.variable_length_checking(new_date[3], 5) == False:
         failure_list = [False, "The zip code field must be filled."]
         return failure_list
     elif eh.nonblank_string(new_date[4]) == False:
         failure_list = [False, "The venue field must be filled."]
         return failure_list
     elif eh.variable_length_checking(new_date[5], 10) == False:
         failure_list = [False, "The phone number field must be filled."]
         return failure_list
     elif eh.nonblank_string(new_date[6]) == False:
         failure_list = [False, "The date field must be filled."]
         return failure_list
     elif eh.range_integer_input_checking(new_date[7], 0, 99999) == False:
         failure_list = [False, "The capacity field must be filled."]
         return failure_list
     elif eh.float_check_range(new_date[8], 0, float('inf')) == False:
         failure_list = [False, "The cover charge field must be a positive integer."]
         return failure_list
     elif eh.float_check_range(new_date[9], 0, float('inf')) == False:
         failure_list = [False, "The door pay field must be filled."]
         return failure_list
     else:
         success_list = [True, "All input fields have been entered correctly."]
         return success_list
Esempio n. 2
0
 def merch_list_testing(self, merch_list):
     eh = ErrorHandling()
     if eh.nonblank_string(merch_list[0]) == False:
         failure_list = [False, "The type field must be filled."]
         return failure_list
     elif eh.float_check_range(merch_list[1], 0, float('inf')) == False:
         failure_list = [False, "The price field must be an number."]
         return failure_list
     elif eh.float_check_range(merch_list[2], 0, float('inf')) == False:
         failure_list = [False, "The unit cost must be a positive number."]
         return failure_list
     elif eh.range_integer_input_checking(merch_list[3], 0, float('inf')) == False:
         failure_list = [False, "The quanitity must be a positive number."]
         return failure_list
     else:
         success_list = [True, "All input fields have been entered correctly."]
         return success_list