Skip to content

Commit

Permalink
mocking video_frame data
Browse files Browse the repository at this point in the history
  • Loading branch information
wonjuleee committed Nov 13, 2023
1 parent 3055abb commit caac995
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/integration/cli/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import os
import os.path as osp
from unittest.case import TestCase
from unittest.mock import PropertyMock, patch

import numpy as np
import pytest

from datumaro.components.media_manager import MediaManager
Expand All @@ -14,11 +16,12 @@
from tests.utils.test_utils import run_datum as run


@pytest.mark.xfail(reason="This test is flaky so that can fail randomly")
class VideoSplittingTest:
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
@scoped
def test_can_split_video(self):
@patch("datumaro.components.media.VideoFrame.data", new_callable=PropertyMock)
def test_can_split_video(self, mock_video_frame_data):
mock_video_frame_data.return_value = np.full((32, 32, 3), fill_value=0, dtype=np.uint8)
on_exit_do(MediaManager.get_instance().clear)

test_dir = scope_add(TestDir())
Expand Down

0 comments on commit caac995

Please sign in to comment.