def test_format_file():
    new_file = {
        'title_id': '30',
        'tape_number': '10',
        'side_id': 'A',
        'title': 'Battlefield Earth',
        'sub_chapter': '20',
        'file_type': 'mp4a'
    }

    expected_name = '10A20_Battlefield Earth.mp4a'

    assert filenamer(new_file) == expected_name
def test_filenamer_formats_filename_correctly():
    for truthy, original, parsed, formatted in correct_title_names:
        if truthy:
            assert filenamer(parsed) == formatted
        else:
            assert filenamer(parsed) != formatted