python 3 fixes

test fixes

python 3 fixes

test fixes

test fixes

quality fix

python 3 fixes

minor fixes
This commit is contained in:
aarif
2019-09-11 17:15:28 +05:00
parent 6f1c05e28c
commit 1793de5cbb

View File

@@ -5,6 +5,7 @@ Video xmodule tests in mongo.
from __future__ import absolute_import
import io
import json
import shutil
from collections import OrderedDict
@@ -1687,9 +1688,10 @@ class VideoBlockTest(TestCase, VideoBlockTestBase):
self.assertEqual([transcript_file_name], self.file_system.listdir(EXPORT_IMPORT_STATIC_DIR))
# Also verify the content of created transcript file.
expected_transcript_content = File(open(expected_transcript_path)).read()
expected_transcript_content = File(io.open(expected_transcript_path)).read()
transcript = get_video_transcript_data(video_id=self.descriptor.edx_video_id, language_code=language_code)
self.assertEqual(transcript['content'], expected_transcript_content)
self.assertEqual(transcript['content'].decode('utf-8'), expected_transcript_content)
@ddt.data(
(['en', 'da'], 'test_sub', ''),
@@ -1747,9 +1749,10 @@ class VideoBlockTest(TestCase, VideoBlockTestBase):
combine(self.temp_dir, EXPORT_IMPORT_COURSE_DIR),
combine(EXPORT_IMPORT_STATIC_DIR, expected_transcripts[language])
)
expected_transcript_content = File(open(expected_transcript_path)).read()
expected_transcript_content = File(io.open(expected_transcript_path)).read()
transcript = get_video_transcript_data(video_id=self.descriptor.edx_video_id, language_code=language)
self.assertEqual(transcript['content'], expected_transcript_content)
self.assertEqual(transcript['content'].decode('utf-8'), expected_transcript_content)
def test_export_val_data_not_found(self):
"""