def testBadForm(self): """ Required form fields are missing -> bad form message. """ #only a password form = cgifactory.get(**{'pass': '******'}) response = self.query(upload.main, form) #print(response) self.assertIn('BAD_SUBMITTED_FORM', response)
def testGoodSubmission(self): """ Required form fields are missing -> bad form message. """ #only a password form = cgifactory.get(uploaded=self.file) response = self.query(submit.main, form) #print(response) self.assertIn("Submission completed successfully", response) self.assertIn("disabled", response) # gradepipe was really off?
def testBadContext(self): """ Various context problems -> appropriate message. """ tests = { 'A01': 'BAD_SUBMITTED_FORM', 'JohndoeA99.java': 'NO_UPLOADED_FILE', } for file, error in tests.items(): form = cgifactory.get(uploaded=file) response = self.query(submit.main, form) #print(response) self.assertIn(error, response)
def testDefault(self): """ No arguments -> print an input form.""" form = cgifactory.get() response = self.query(upload.main, form) #print(response) self.assertIn('<form', response)
def testBadForm(self): """ Required form fields are missing -> bad form message. """ form = cgifactory.get(upload=self.file) #should be uploaded= response = self.query(submit.main, form) #print(response) self.assertIn('BAD_SUBMITTED_FORM', response)