コード例 #1
0
 def test_ts_missing_param(self):
     #test total_submission_checker() with missing parameters, expect an error
     excel_sheet = utils.access_excel('Invalid file')
     time.sleep(5)
     self.assertEqual(utils.total_submission_checker(excel_sheet),
                      "End of total submission checker",
                      "Invalid excel sheet passed in")
コード例 #2
0
 def test_ts_invalid_file(self):
     #test total_submission_checker() with an invalid file as input, expect an error
     excel_sheet = utils.access_excel('Invalid file')
     time.sleep(5)
     self.assertEqual(utils.total_submission_checker(4, excel_sheet),
                      "End of total submission checker",
                      "Invalid excel sheet passed in")
コード例 #3
0
 def test_ts_char_input(self):
     #test total_submission_checker() with a char input, expect an error
     excel_sheet = utils.access_excel(
         'Capstone groups preferences (Responses)')
     time.sleep(5)
     self.assertEqual(utils.total_submission_checker('c', excel_sheet),
                      "End of total submission checker", "char input")
コード例 #4
0
 def test_ts_edge_case2(self):
     #test total_submission_checker() with proper inputs, expect to have no issues
     excel_sheet = utils.access_excel(
         'Capstone groups preferences (Responses)')
     time.sleep(5)
     self.assertEqual(utils.total_submission_checker(99, excel_sheet),
                      "End of total submission checker", "No issues")
コード例 #5
0
 def test_ts_hundred_plus(self):
     #test total_submission_checker() with excessive total number of groups as input
     excel_sheet = utils.access_excel(
         'Capstone groups preferences (Responses)')
     time.sleep(5)
     self.assertEqual(utils.total_submission_checker(105, excel_sheet),
                      "Invalid total groups, it should be at most 100",
                      "Should be <= 100")
コード例 #6
0
 def test_ts_negative(self):
     #test total_submission_checker() with negative total number of groups as input
     excel_sheet = utils.access_excel(
         'Capstone groups preferences (Responses)')
     time.sleep(5)
     self.assertEqual(utils.total_submission_checker(-10, excel_sheet),
                      "Invalid total groups, it should be more than zero",
                      "Should be > 0")
コード例 #7
0
 def test_ts_no_issue(self):
     #test total_submission_checker() with proper inputs, expect to have no issues
     total_groups_number = 24  #you may change this line if the total number of groups is updated
     excel_sheet = utils.access_excel(
         'Capstone groups preferences (Responses)')
     time.sleep(5)
     self.assertEqual(
         utils.total_submission_checker(total_groups_number, excel_sheet),
         "End of total submission checker", "No issues")
コード例 #8
0
import utils

#to access the online excel sheet
excel_sheet = utils.access_excel()
#key in the total number of groups foor the year
total_groups_number = 4
#check for correct submissions count
utils.total_submission_checker(total_groups_number, excel_sheet)
#check for duplicate in submissions
utils.duplicate_checker(excel_sheet)



    
コード例 #9
0
ファイル: testing.py プロジェクト: YangZhi1/ESC
 def test_negative(self):
     excel_sheet = utils.access_excel()
     self.assertEqual(utils.total_submission_checker(-10, excel_sheet), "Invalid total groups, it should be more than zero", "Should be > 0")
コード例 #10
0
ファイル: testing.py プロジェクト: YangZhi1/ESC
 def test_hundred_plus(self):
     excel_sheet = utils.access_excel()
     self.assertEqual(utils.total_submission_checker(105, excel_sheet), "Invalid total groups, it should be at most 100", "Should be <= 100")