'Test that reindexes courses when given single course key or a list of course keys'

def test_given_id_list_indexes_courses(self):

    with mock.patch(self.REINDEX_PATH_LOCATION) as patched_index:
        with mock.patch(self.MODULESTORE_PATCH_LOCATION, mock.Mock(return_value=self.store)):
            call_command('reindex_course', unicode(self.first_course.id))
            self.assertEqual(patched_index.mock_calls, self._build_calls(self.first_course))
            patched_index.reset_mock()
            call_command('reindex_course', unicode(self.second_course.id))
            self.assertEqual(patched_index.mock_calls, self._build_calls(self.second_course))
            patched_index.reset_mock()
            call_command('reindex_course', unicode(self.first_course.id), unicode(self.second_course.id))
            expected_calls = self._build_calls(self.first_course, self.second_course)
            self.assertEqual(patched_index.mock_calls, expected_calls)
