Exemplo n.º 1
0
 def test_invalid_json(self):
     """
     Test invalid json raises exception
     """
     for error_inputs, error_message in INVALID_JSON_INPUTS:
         for error_input in error_inputs:
             with self.assertRaisesRegexp(LtiError, error_message):
                 parse_result_json(error_input)
Exemplo n.º 2
0
 def test_invalid_json(self):
     """
     Test invalid json raises exception
     """
     for error_inputs, error_message in INVALID_JSON_INPUTS:
         for error_input in error_inputs:
             with self.assertRaisesRegexp(LtiError, error_message):
                 parse_result_json(error_input)
Exemplo n.º 3
0
 def test_valid_json(self):
     """
     Test valid json returns expected values
     """
     for json_str, expected_score, expected_comment in VALID_JSON_INPUTS:
         score, comment = parse_result_json(json_str)
         self.assertEqual(score, expected_score)
         self.assertEqual(comment, expected_comment)
Exemplo n.º 4
0
 def test_valid_json(self):
     """
     Test valid json returns expected values
     """
     for json_str, expected_score, expected_comment in VALID_JSON_INPUTS:
         score, comment = parse_result_json(json_str)
         self.assertEqual(score, expected_score)
         self.assertEqual(comment, expected_comment)