MCPcopy
hub / github.com/beetbox/beets / test_explicit

Method test_explicit

test/test_query.py:362–374  ·  view source on GitHub ↗

Test explicit path queries with different path specifications.

(
        self, monkeypatch, lib, path, expected_titles, trailing_sep
    )

Source from the content-addressed store, hash-verified

360 ],
361 )
362 def test_explicit(
363 self, monkeypatch, lib, path, expected_titles, trailing_sep
364 ):
365 """Test explicit path queries with different path specifications."""
366 monkeypatch.setattr("beets.util.case_sensitive", lambda *_: True)
367 if path == r"c\.mp3$":
368 q = f"path::{path}"
369 elif path == r"/c/\x" and os.path.__name__ != "ntpath":
370 q = r"path:/c/\\x"
371 else:
372 q = f"path:{self.abs_query_path(path, trailing_sep=trailing_sep)}"
373
374 assert {i.title for i in lib.items(q)} == set(expected_titles)
375
376 @pytest.mark.parametrize(
377 "query", ["path:", "path::"], ids=["path", "regex"]

Callers

nothing calls this directly

Calls 2

abs_query_pathMethod · 0.95
itemsMethod · 0.45

Tested by

no test coverage detected