Commit be28e5c4 by Muhammad Ammar Committed by GitHub

Merge pull request #14314 from edx/ammar/log-videoid-and-status

log video id and status along with message
parents 577dea6a 36dfc2c0
...@@ -488,13 +488,13 @@ class VideosHandlerTestCase(VideoUploadTestMixin, CourseTestCase): ...@@ -488,13 +488,13 @@ class VideosHandlerTestCase(VideoUploadTestMixin, CourseTestCase):
# Test should fail if video not found # Test should fail if video not found
self.assertEqual(True, False, 'Invalid edx_video_id') self.assertEqual(True, False, 'Invalid edx_video_id')
def test_video_status_update_request(self): @patch('contentstore.views.videos.LOGGER')
def test_video_status_update_request(self, mock_logger):
""" """
Verifies that video status update request works as expected. Verifies that video status update request works as expected.
""" """
url = self.get_url_for_course_key(self.course.id) url = self.get_url_for_course_key(self.course.id)
edx_video_id = 'test1' edx_video_id = 'test1'
self.assert_video_status(url, edx_video_id, 'Uploading') self.assert_video_status(url, edx_video_id, 'Uploading')
response = self.client.post( response = self.client.post(
...@@ -506,6 +506,14 @@ class VideosHandlerTestCase(VideoUploadTestMixin, CourseTestCase): ...@@ -506,6 +506,14 @@ class VideosHandlerTestCase(VideoUploadTestMixin, CourseTestCase):
}]), }]),
content_type="application/json" content_type="application/json"
) )
mock_logger.info.assert_called_with(
'VIDEOS: Video status update with id [%s], status [%s] and message [%s]',
edx_video_id,
'upload_failed',
'server down'
)
self.assertEqual(response.status_code, 204) self.assertEqual(response.status_code, 204)
self.assert_video_status(url, edx_video_id, 'Failed') self.assert_video_status(url, edx_video_id, 'Failed')
......
...@@ -453,7 +453,12 @@ def send_video_status_update(updates): ...@@ -453,7 +453,12 @@ def send_video_status_update(updates):
""" """
for update in updates: for update in updates:
update_video_status(update.get('edxVideoId'), update.get('status')) update_video_status(update.get('edxVideoId'), update.get('status'))
LOGGER.info(update.get('message')) LOGGER.info(
'VIDEOS: Video status update with id [%s], status [%s] and message [%s]',
update.get('edxVideoId'),
update.get('status'),
update.get('message')
)
return JsonResponse() return JsonResponse()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment