Fix many wrong-assert-type errors

This commit is contained in:
Ned Batchelder
2016-07-31 10:47:17 -04:00
parent eef964f5f6
commit 8571ceabeb
51 changed files with 228 additions and 199 deletions

View File

@@ -544,7 +544,7 @@ class MatlabTest(unittest.TestCase):
test_capa_system().xqueue['interface'].send_to_queue.assert_called_with(header=ANY, body=ANY)
self.assertTrue(response['success'])
self.assertTrue(self.the_input.input_state['queuekey'] is not None)
self.assertIsNotNone(self.the_input.input_state['queuekey'])
self.assertEqual(self.the_input.input_state['queuestate'], 'queued')
def test_plot_data_failure(self):
@@ -572,8 +572,8 @@ class MatlabTest(unittest.TestCase):
queue_msg = json.dumps({'msg': inner_msg})
the_input.ungraded_response(queue_msg, queuekey)
self.assertTrue(input_state['queuekey'] is None)
self.assertTrue(input_state['queuestate'] is None)
self.assertIsNone(input_state['queuekey'])
self.assertIsNone(input_state['queuestate'])
self.assertEqual(input_state['queue_msg'], inner_msg)
@patch('capa.inputtypes.time.time', return_value=10)

View File

@@ -71,7 +71,7 @@ class ResponseTest(unittest.TestCase):
def assert_answer_format(self, problem): # pylint: disable=missing-docstring
answers = problem.get_question_answers()
self.assertTrue(answers['1_2_1'] is not None)
self.assertIsNotNone(answers['1_2_1'])
def assert_multiple_grade(self, problem, correct_answers, incorrect_answers): # pylint: disable=missing-docstring
for input_str in correct_answers: