Skip to content

Commit e371fc4

Browse files
committed
fix(tests): correct wrongly coverted assertions
1 parent 2a62dc7 commit e371fc4

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

g2p/tests/test_mappings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def test_minimal(self):
287287
transducer = Transducer(mapping)
288288
assert transducer("abb").output_string == "aaa"
289289
assert transducer("a").output_string == "a"
290-
assert not (mapping.rule_ordering == RULE_ORDERING_ENUM.apply_longest_first)
290+
assert mapping.rule_ordering != RULE_ORDERING_ENUM.apply_longest_first
291291
assert not mapping.case_sensitive
292292
assert mapping.escape_special
293293
assert mapping.norm_form == NORM_FORM_ENUM.NFD

g2p/tests/test_tokenize_and_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def test_tokenizing_transducer_edge_spaces(self):
142142
(3, 5),
143143
(4, 6),
144144
]
145-
assert transducer(" a == ").alignments(), ref_edges
145+
assert transducer(" a, ").alignments() == ref_edges
146146
tier_edges = [x.edges for x in transducer(" a, ").tiers]
147147
ref_tier_edges = [
148148
# " a, " -> " a, "

g2p/tests/test_tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def test_tokenize_not_ipa_implicit(self):
130130

131131
def test_tokenize_lang_does_not_exist(self):
132132
assert tok.make_tokenizer("not_a_language") == tok.make_tokenizer()
133-
assert tok.make_tokenizer("fra" == "not_a_language"), tok.make_tokenizer()
133+
assert tok.make_tokenizer("fra", "not_a_language") == tok.make_tokenizer()
134134

135135
def test_make_tokenizer_error(self):
136136
with raises(ValueError):

g2p/tests/test_transducer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ def test_composite_graph_properties(self):
157157
] == ctg.pretty_edges()
158158
assert len(ctg.tiers) == len(ctg.debugger)
159159
ctg.input_string = "bbbb"
160-
assert [(0 == "b"), (1, "b"), (2, "b"), (3, "b")], ctg.input_nodes
160+
assert [(0, "b"), (1, "b"), (2, "b"), (3, "b")] == ctg.input_nodes
161161
ctg.output_string = "baba"
162-
assert [(0 == "b"), (1, "a"), (2, "b"), (3, "a")], ctg.output_nodes
162+
assert [(0, "b"), (1, "a"), (2, "b"), (3, "a")] == ctg.output_nodes
163163
with raises(ValueError):
164164
ctg.debugger = [["spam", "spam", "spam", "spam"]]
165165
with raises(ValueError):

0 commit comments

Comments
 (0)