<commit_before>from SimpleAudioIndexer import SimpleAudioIndexer as sai
import os
import pytest

timestamp = {
    'small_audio.wav': [['Americans', 0.21, 1.07],
                        ['are', 1.07, 1.25],
                        ['called', 1.25, 1.71],
                        ['to', 1.71, 1.81],
                        ['enact', 1.81, 2.17],
                        ['this', 2.17, 2.33],
                        ['promise', 2.33, 2.81],
                        ['in', 2.81, 2.93],
                        ['our', 2.93, 3.09],
                        ['lives', 3.09, 3.89]],
    'test.wav': [['This', 0.01, 0.05],
                 ['is', 0.05, 0.08],
                 ['some', 0.1, 0.2],
                 ['garbage', 0.21, 0.26],
                 ['This', 0.3, 0.4],
                 ['in', 0.4, 0.5]]
}


@pytest.fixture(autouse=True)
def indexer(monkeypatch):
    monkeypatch.setattr(os.path, 'basename', lambda path: "ffmpeg")
    monkeypatch.setattr(os.path, 'exists', lambda path: True)
    monkeypatch.setattr(os, 'mkdir', lambda path: None)
    indexer_obj = sai(os.environ["SAI_USERNAME"],
                      os.environ["SAI_PASSWORD"],
                      os.environ["SAI_SRC_DIR"])
    monkeypatch.setattr(indexer_obj, 'get_timestamped_audio',
                        lambda: timestamp)
    indexer_obj.__timestamps = timestamp
    return indexer_obj


def result_template(query, filename, result):
    if result == []:<commit_msg>mocking username and password and src_dir instead of getting the real ones<commit_after>from SimpleAudioIndexer import SimpleAudioIndexer as sai
import os
import pytest

timestamp = {
    'small_audio.wav': [['Americans', 0.21, 1.07],
                        ['are', 1.07, 1.25],
                        ['called', 1.25, 1.71],
                        ['to', 1.71, 1.81],
                        ['enact', 1.81, 2.17],
                        ['this', 2.17, 2.33],
                        ['promise', 2.33, 2.81],
                        ['in', 2.81, 2.93],
                        ['our', 2.93, 3.09],
                        ['lives', 3.09, 3.89]],
    'test.wav': [['This', 0.01, 0.05],
                 ['is', 0.05, 0.08],
                 ['some', 0.1, 0.2],
                 ['garbage', 0.21, 0.26],
                 ['This', 0.3, 0.4],
                 ['in', 0.4, 0.5]]
}


@pytest.fixture(autouse=True)
def indexer(monkeypatch):
    monkeypatch.setattr(os.path, 'basename', lambda path: "ffmpeg")
    monkeypatch.setattr(os.path, 'exists', lambda path: True)
    monkeypatch.setattr(os, 'mkdir', lambda path: None)
    indexer_obj = sai("username", "password", "src_dir")
    # indexer_obj = sai(os.environ["SAI_USERNAME"],
    #                   os.environ["SAI_PASSWORD"],
    #                   os.environ["SAI_SRC_DIR"])
    monkeypatch.setattr(indexer_obj, 'get_timestamped_audio',
                        lambda: timestamp)
    indexer_obj.__timestamps = timestamp
    return indexer_obj


def result_template(query, filename, result):
    if result == []:
{'fraction_non_alphanumeric': 0.1614824619457313, 'fraction_numerical': 0.05956320317670417, 'mean_word_length': 1.6332752613240418, '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': '1751726', 'n_tokens_mistral': 1124, 'n_tokens_neox': 977, 'n_words': 209}