Exemplo n.º 1
0
def test_folder_playlist(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'folder',
        'playlist',
        *fixtures.folders,
    ])
Exemplo n.º 2
0
def test_local_stats(cli_runner, common_args):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'local',
        'stats',
        *common_args,
    ])
Exemplo n.º 3
0
def test_youtube_find(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'youtube',
        'find',
        fixtures.one_mp3,
    ])
Exemplo n.º 4
0
def test_local_query(cli_runner, edgedb):
    run_cli(cli_runner, cli, [
        '--quiet',
        'local', 'query',
        'select Music;',
        '--dsn', edgedb,
    ])
Exemplo n.º 5
0
def test_local_player(cli_runner, common_args):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'local',
        'player',
        *common_args,
    ])
Exemplo n.º 6
0
def test_youtube_fingerprint(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'youtube',
        'fingerprint',
        fixtures.youtube_url,
    ])
Exemplo n.º 7
0
def test_folder_check_consistency(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'folder',
        'consistency',
        *fixtures.folders,
    ])
Exemplo n.º 8
0
def test_local_sync(cli_runner, edgedb):
    run_cli(cli_runner, cli, [
        '--quiet',
        'local', 'sync',
        '--dsn', edgedb,
        '/tmp',
        '--dry',
    ])
Exemplo n.º 9
0
def test_local_query(cli_runner, common_args):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'local',
        'query',
        *common_args,
        '{doFilterList(minRating: 5.0, artists: ["Buckethead"]){keywords}}',
    ])
Exemplo n.º 10
0
def test_filter_delete(cli_runner, common_args):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'filter',
        'delete',
        *common_args,
        'default',
    ])
Exemplo n.º 11
0
def test_cli_version(cli_runner):
    output1 = strip_colors(run_cli(cli_runner, main_cli, ['--quiet', '-V']))
    output2 = strip_colors(
        run_cli(cli_runner, main_cli, ['--quiet', '--version']))
    output3 = strip_colors(
        run_cli(cli_runner, main_cli, ['--quiet', 'version']))
    assert output1 == output2 == output3
    assert __version__ in output1
Exemplo n.º 12
0
def test_filter_show(cli_runner, common_args):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'filter',
        'show',
        *common_args,
        'default',
    ])
Exemplo n.º 13
0
def test_folder_flac2mp3(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'folder',
        'flac2mp3',
        '--dry',
        *fixtures.folders,
    ])
Exemplo n.º 14
0
def test_youtube_search(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'youtube',
        'search',
        'buckethead',
        'welcome to bucketheadland',
    ])
Exemplo n.º 15
0
def test_local_bests(cli_runner, edgedb):
    run_cli(cli_runner, cli, [
        '--quiet',
        'local', 'bests',
        '--dsn', edgedb,
        '/tmp',
        '--dry',
    ])
Exemplo n.º 16
0
def test_music_flac2mp3(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'flac2mp3',
        str(fixtures.one_flac),
        '/tmp',
    ])
Exemplo n.º 17
0
def test_music_flac2mp3(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'flac2mp3',
        fixtures.one_flac,
        '--folder',
        '/tmp',
    ])
Exemplo n.º 18
0
def test_local_bests(cli_runner, common_args):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'local',
        'bests',
        *common_args,
        '/tmp',
        '--dry',
    ])
Exemplo n.º 19
0
def test_youtube_download(cli_runner):
    try:
        run_cli(cli_runner, cli, [
            '--quiet',
            'youtube', 'download',
            'buckethead', 'welcome to bucketheadland',
            '--path', 'test.mp3',
        ])
    finally:
        try:
            os.remove('test.mp3')
        except OSError:
            pass
Exemplo n.º 20
0
def test_music_check_consistency(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'consistency',
        str(fixtures.one_flac),
    ])
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'consistency',
        str(fixtures.one_mp3),
    ])
Exemplo n.º 21
0
def test_music_tags(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'tags',
        fixtures.one_flac,
    ])
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'tags',
        fixtures.one_mp3,
    ])
Exemplo n.º 22
0
def test_music_tags(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'tags',
        str(fixtures.one_flac),
    ])
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'tags',
        str(fixtures.one_mp3),
    ])
Exemplo n.º 23
0
def test_music_check_consistency(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'consistency',
        fixtures.one_flac,
    ])
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'consistency',
        fixtures.one_mp3,
    ])
Exemplo n.º 24
0
def common_args(cli_runner, user_token, postgraphile_public):
    common = ['-t', user_token, '-g', postgraphile_public]
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'local', 'scan',
        *common,
        *fixtures.folders,
    ])
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'filter', 'load',
        *common,
    ])
    return common
Exemplo n.º 25
0
def test_music_delete_keywords(cli_runner):
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'delete-keywords',
        str(fixtures.one_flac),
        'test',
        '--dry',
    ])
    run_cli(cli_runner, cli, [
        '--quiet',
        'music',
        'delete-keywords',
        str(fixtures.one_mp3),
        'test',
        '--dry',
    ])
Exemplo n.º 26
0
def test_local_playlist(cli_runner, edgedb):
    output = run_cli(cli_runner, cli, [
        '--quiet',
        'local', 'playlist',
        '--dsn', edgedb,
        '--output', 'json',
    ])
    json.loads(output)
Exemplo n.º 27
0
def test_folder_find(cli_runner):
    musics = run_cli(cli_runner, cli, [
        '--quiet',
        'folder',
        'find',
        *fixtures.folders,
    ])
    assert len(mysplit(musics, "\n")) == 5
Exemplo n.º 28
0
def test_music_add_keywords(cli_runner):
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'add-keywords',
        fixtures.one_flac,
        'test',
        '--dry',
    ])
    run_cli(cli_runner, main_cli, [
        '--quiet',
        'music',
        'add-keywords',
        fixtures.one_mp3,
        'test',
        '--dry',
    ])
Exemplo n.º 29
0
def test_filter_count(cli_runner, common_args):
    count_filters_str = run_cli(cli_runner, main_cli, [
        '--quiet',
        'filter',
        'count',
        *common_args,
    ])
    count_filters = int(count_filters_str)
    assert count_filters == 15
Exemplo n.º 30
0
def test_local_count(cli_runner, common_args):
    local_count_str = run_cli(cli_runner, main_cli, [
        '--quiet',
        'local',
        'count',
        *common_args,
    ])
    local_count = int(local_count_str)
    assert local_count == 5