mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Refactor tests to make
This commit is contained in:
parent
617509262e
commit
19eb729db3
1 changed files with 8 additions and 7 deletions
|
|
@ -30,18 +30,18 @@ class SubstitutePluginTest(PluginTestCase):
|
||||||
def test_simple_substitute(self):
|
def test_simple_substitute(self):
|
||||||
self.run_substitute(
|
self.run_substitute(
|
||||||
{
|
{
|
||||||
"a": "b",
|
"a": "x",
|
||||||
"b": "c",
|
"b": "y",
|
||||||
"c": "d",
|
"c": "z",
|
||||||
},
|
},
|
||||||
[("a", "b"), ("b", "c"), ("c", "d")],
|
[("a", "x"), ("b", "y"), ("c", "z")],
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_case_insensitivity(self):
|
def test_case_insensitivity(self):
|
||||||
self.run_substitute({"a": "b"}, [("A", "b")])
|
self.run_substitute({"a": "x"}, [("A", "x")])
|
||||||
|
|
||||||
def test_unmatched_input_preserved(self):
|
def test_unmatched_input_preserved(self):
|
||||||
self.run_substitute({"a": "b"}, [("c", "c")])
|
self.run_substitute({"a": "x"}, [("c", "c")])
|
||||||
|
|
||||||
def test_regex_to_static(self):
|
def test_regex_to_static(self):
|
||||||
self.run_substitute(
|
self.run_substitute(
|
||||||
|
|
@ -66,11 +66,12 @@ class SubstitutePluginTest(PluginTestCase):
|
||||||
def test_partial_substitution(self):
|
def test_partial_substitution(self):
|
||||||
self.run_substitute({r"\.": ""}, [("U.N.P.O.C.", "UNPOC")])
|
self.run_substitute({r"\.": ""}, [("U.N.P.O.C.", "UNPOC")])
|
||||||
|
|
||||||
def test_break_on_first_match(self):
|
def test_rules_applied_in_definition_order(self):
|
||||||
self.run_substitute(
|
self.run_substitute(
|
||||||
{
|
{
|
||||||
"a": "x",
|
"a": "x",
|
||||||
"[ab]": "y",
|
"[ab]": "y",
|
||||||
|
"b": "z",
|
||||||
},
|
},
|
||||||
[
|
[
|
||||||
("a", "x"),
|
("a", "x"),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue