-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from nattvara/update-capture-preview
Update capture preview job
- Loading branch information
Showing
9 changed files
with
76 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import shutil | ||
|
||
from jobs import capture_preview | ||
from db.models import Lecture | ||
|
||
|
||
def test_download_of_kth_play_lecture_saves_mp4_file(mocker, mp4_file, img_file): | ||
def save_photo_from_video(mp4_filepath: str, output_file: str, small=False): | ||
shutil.copy(img_file, output_file) | ||
|
||
func = mocker.patch('tools.video.img.save_photo_from_video', side_effect=save_photo_from_video) | ||
|
||
lecture = Lecture( | ||
public_id='some_id', | ||
language=Lecture.Language.SWEDISH, | ||
mp4_filepath=mp4_file, | ||
approved=True, | ||
source=Lecture.Source.KTH, | ||
) | ||
lecture.save() | ||
|
||
capture_preview.job(lecture.public_id, lecture.language) | ||
lecture.refresh() | ||
|
||
assert lecture.img_preview == lecture.preview_filename() | ||
assert lecture.img_preview_small == lecture.preview_small_filename() | ||
assert func.call_count == 2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,6 +56,10 @@ | |
color: black; | ||
} | ||
|
||
.source { | ||
color: black; | ||
} | ||
|
||
.length { | ||
color: black; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters