<commit_before>import json
import subprocess
from io import BytesIO

import pytest

import madam.video
from madam.core import OperatorError
from madam.future import subprocess_run
from assets import y4m_asset, unknown_asset


class TestFFmpegProcessor:
    @pytest.fixture(name='processor')
    def ffmpeg_processor(self):
        return madam.video.FFmpegProcessor()

    def test_converted_asset_receives_correct_mime_type(self, processor, y4m_asset):
        conversion_operator = processor.convert(mime_type='video/webm')

        converted_asset = conversion_operator(y4m_asset)

        assert converted_asset.mime_type == 'video/webm'

    def test_convert_creates_new_asset(self, processor, y4m_asset):
        conversion_operator = processor.convert(mime_type='video/webm')

        converted_asset = conversion_operator(y4m_asset)

        assert isinstance(converted_asset, madam.core.Asset)<commit_msg>Remove unused import of io.BytesIO.<commit_after>import json
import subprocess

import pytest

import madam.video
from madam.core import OperatorError
from madam.future import subprocess_run
from assets import y4m_asset, unknown_asset


class TestFFmpegProcessor:
    @pytest.fixture(name='processor')
    def ffmpeg_processor(self):
        return madam.video.FFmpegProcessor()

    def test_converted_asset_receives_correct_mime_type(self, processor, y4m_asset):
        conversion_operator = processor.convert(mime_type='video/webm')

        converted_asset = conversion_operator(y4m_asset)

        assert converted_asset.mime_type == 'video/webm'

    def test_convert_creates_new_asset(self, processor, y4m_asset):
        conversion_operator = processor.convert(mime_type='video/webm')

        converted_asset = conversion_operator(y4m_asset)

        assert isinstance(converted_asset, madam.core.Asset)
{'fraction_non_alphanumeric': 0.0722495894909688, 'fraction_numerical': 0.005473453749315818, 'mean_word_length': 4.877813504823151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '469077', 'n_tokens_mistral': 565, 'n_tokens_neox': 547, 'n_words': 107}