def it_can_construct_from_a_path(self, video_, from_blob_): with open(TEST_VIDEO_PATH, "rb") as f: blob = f.read() from_blob_.return_value = video_ video = Video.from_path_or_file_like(TEST_VIDEO_PATH, "video/mp4") Video.from_blob.assert_called_once_with(blob, "video/mp4", "dummy.mp4") assert video is video_
def _video(self): """Return a |Video| object containing the movie file.""" return Video.from_path_or_file_like(self._movie_file, self._mime_type)
def it_can_construct_from_a_stream(self, from_stream_fixture): movie_stream, mime_type, blob, video_ = from_stream_fixture video = Video.from_path_or_file_like(movie_stream, mime_type) Video.from_blob.assert_called_once_with(blob, mime_type, None) assert video is video_
def it_can_construct_from_a_path(self, from_path_fixture): movie_path, mime_type, blob, filename, video_ = from_path_fixture video = Video.from_path_or_file_like(movie_path, mime_type) Video.from_blob.assert_called_once_with(blob, mime_type, filename) assert video is video_