diff --git a/.github/README.md b/.github/README.md index d9d7f56b..15e58c42 100644 --- a/.github/README.md +++ b/.github/README.md @@ -97,7 +97,7 @@ To stop playing press Ctrl+C in either the terminal or mpv
List all subcommands $ library - library (v2.9.019; 82 subcommands) + library (v2.9.020; 82 subcommands) Create database subcommands: ╭─────────────────┬──────────────────────────────────────────╮ diff --git a/tests/multidb/test_merge_dbs.py b/tests/multidb/test_merge_dbs.py index 6e0acf61..f530abce 100644 --- a/tests/multidb/test_merge_dbs.py +++ b/tests/multidb/test_merge_dbs.py @@ -1,18 +1,18 @@ -from tests.utils import connect_db_args, tube_db, v_db +from tests.utils import connect_db_args, links_db, v_db from xklb.lb import library as lb def test_merge(temp_db): db1 = temp_db() - lb(["merge-dbs", "--pk", "path", tube_db, v_db, db1]) + lb(["merge-dbs", "--pk", "path", links_db, v_db, db1]) args = connect_db_args(db1) - assert args.db.pop("SELECT COUNT(*) FROM media") == 6 + assert args.db.pop("SELECT COUNT(*) FROM media") == 14 def test_split(temp_db): db1 = temp_db() - lb(["merge-dbs", "--pk", "path", tube_db, v_db, db1, "-t", "media", "--where", 'path like "http%"']) + lb(["merge-dbs", "--pk", "path", links_db, v_db, db1, "-t", "media", "--where", 'path like "http%"']) args = connect_db_args(db1) - assert args.db.pop("SELECT COUNT(*) FROM media") == 2 + assert args.db.pop("SELECT COUNT(*) FROM media") == 10 diff --git a/tests/playback/test_links_open.py b/tests/playback/test_links_open.py index d083d504..4a70a947 100644 --- a/tests/playback/test_links_open.py +++ b/tests/playback/test_links_open.py @@ -1,26 +1,8 @@ from unittest import mock +from tests.utils import links_db from xklb.lb import library as lb -links_db = "tests/data/links.db" -lb( - [ - "links-add", - links_db, - "-c=p1", - "--insert-only", - "https://site0", - "https://site1", - "https://site2", - "https://site3", - "https://site4", - "https://site5", - "https://site6", - "https://site7", - "https://site8", - ], -) - @mock.patch("xklb.playback.links_open.make_souffle") def test_links_open(mock_souffle): diff --git a/tests/test_lb.py b/tests/test_lb.py index da798238..084953bb 100644 --- a/tests/test_lb.py +++ b/tests/test_lb.py @@ -64,7 +64,6 @@ def test_pytest_files_exist(path): p("tests/misc/test_dedupe_czkawka.py"), p("tests/misc/test_export_text.py"), p("tests/multidb/test_copy_play_counts.py"), - p("tests/multidb/test_merge_dbs.py"), p("tests/playback/test_playback_control.py"), p("tests/playback/test_surf.py"), # TODO: remove one line when you see this ): diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py index 53b3fc54..4e9e68aa 100644 --- a/tests/utils/__init__.py +++ b/tests/utils/__init__.py @@ -47,6 +47,26 @@ def get_default_args(*funcs): return defaults +links_db = "tests/data/links.db" +if not Path(links_db).exists(): + lb( + [ + "links-add", + links_db, + "-c=p1", + "--insert-only", + "https://site0", + "https://site1", + "https://site2", + "https://site3", + "https://site4", + "https://site5", + "https://site6", + "https://site7", + "https://site8", + ], + ) + v_db = "tests/data/video.db" if not Path(v_db).exists(): lb(["fs_add", v_db, "--scan-subtitles", "tests/data/", "-E", "Youtube"]) diff --git a/tests/utils/test_printing.py b/tests/utils/test_printing.py index 1b2ab1eb..659bf617 100644 --- a/tests/utils/test_printing.py +++ b/tests/utils/test_printing.py @@ -15,7 +15,7 @@ def test_tw_print(capsys): ]: lb(lb_command) captured = capsys.readouterr().out.replace("\n", "") - assert "Aggregate" not in captured + assert "Agg" not in captured for lb_command in [ ["tw", v_db, "-p", "a"], @@ -25,7 +25,7 @@ def test_tw_print(capsys): ]: lb(lb_command) captured = capsys.readouterr().out.replace("\n", "") - assert ("Aggregate" in captured) or ("extractor_key" in captured) + assert ("Agg" in captured) or ("extractor_key" in captured) def test_col_naturaldate(): diff --git a/xklb/__init__.py b/xklb/__init__.py index 8d9875c6..51b8236f 100644 --- a/xklb/__init__.py +++ b/xklb/__init__.py @@ -1 +1 @@ -__version__ = "2.9.019" +__version__ = "2.9.020"