Exemplo n.º 1
0
 def test_response_with_multiple_status_fields(self):
     response = self.create_response_object(
         200, self.response_xml,
         major_code='<imsx_codeMajor>success</imsx_codeMajor>'
                    '<imsx_codeMajor>failure</imsx_codeMajor>'
     )
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 2
0
 def test_response_with_multiple_status_fields(self):
     response = self.create_response_object(
         200,
         self.response_xml,
         major_code='<imsx_codeMajor>success</imsx_codeMajor>'
         '<imsx_codeMajor>failure</imsx_codeMajor>')
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 3
0
 def test_response_with_no_status_field(self):
     response = self.create_response_object(200,
                                            self.response_xml,
                                            major_code='')
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 4
0
 def test_response_with_invalid_xml(self):
     xml = '<badly>formatted</xml>'
     response = self.create_response_object(200, xml)
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 5
0
 def test_response_with_bad_status_code(self):
     response = self.create_response_object(500, '')
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 6
0
 def test_response_with_correct_xml(self):
     xml = self.response_xml
     response = self.create_response_object(200, xml)
     self.assertTrue(outcomes.check_replace_result_response(response))
Exemplo n.º 7
0
 def test_response_with_no_status_field(self):
     response = self.create_response_object(
         200, self.response_xml,
         major_code=''
     )
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 8
0
 def test_response_with_invalid_xml(self):
     xml = '<badly>formatted</xml>'
     response = self.create_response_object(200, xml)
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 9
0
 def test_response_with_bad_status_code(self):
     response = self.create_response_object(500, '')
     self.assertFalse(outcomes.check_replace_result_response(response))
Exemplo n.º 10
0
 def test_response_with_correct_xml(self):
     xml = self.response_xml
     response = self.create_response_object(200, xml)
     self.assertTrue(outcomes.check_replace_result_response(response))