def test_engine_properties(mocker, context, attr, cls, call_count):
    mocker.spy(context.modules.importer, 'import_item')
    video_engine = VideoEngine(context)
    # Do twice to test value caching
    for i in range(0, 2):
        val = getattr(video_engine, attr)
        assert isinstance(val, cls)
    assert context.modules.importer.import_item.call_count == call_count
def test_video_engine_setattr_dispatch(mocker, context):
    video_engine = VideoEngine(context)
    mock = mocker.Mock()
    video_engine.engine = mock
    video_engine.foo = 'FOO'
    assert mock.foo == 'FOO'
def test_video_engine_getattr_attributeerror(context):
    video_engine = VideoEngine(context)
    with pytest.raises(AttributeError):
        video_engine.size
def test_video_engine_getattr_dispatch(context):
    video_engine = VideoEngine(context)
    ffmpeg_engine = FFmpegEngine(context)
    video_engine.engine = ffmpeg_engine
    assert video_engine.reorientate == ffmpeg_engine.reorientate