Skip to content

Commit

Permalink
2.9.020
Browse files Browse the repository at this point in the history
  • Loading branch information
chapmanjacobd committed Aug 10, 2024
1 parent 7a3cad7 commit c5e1db3
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ To stop playing press Ctrl+C in either the terminal or mpv
<details><summary>List all subcommands</summary>

$ library
library (v2.9.019; 82 subcommands)
library (v2.9.020; 82 subcommands)

Create database subcommands:
╭─────────────────┬──────────────────────────────────────────╮
Expand Down
10 changes: 5 additions & 5 deletions tests/multidb/test_merge_dbs.py
Original file line number Diff line number Diff line change
@@ -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
20 changes: 1 addition & 19 deletions tests/playback/test_links_open.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
1 change: 0 additions & 1 deletion tests/test_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down
20 changes: 20 additions & 0 deletions tests/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"])
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/test_printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion xklb/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.9.019"
__version__ = "2.9.020"

0 comments on commit c5e1db3

Please sign in to comment.