MCPcopy
hub / github.com/QData/TextAttack / test_printable_text

Method test_printable_text

tests/test_attacked_text.py:87–94  ·  view source on GitHub ↗
(self, attacked_text, attacked_text_pair)

Source from the content-addressed store, hash-verified

85 assert attacked_text_pair.text == "\n".join(raw_text_pair.values())
86
87 def test_printable_text(self, attacked_text, attacked_text_pair):
88 assert attacked_text.printable_text() == raw_text
89 desired_printed_pair_text = (
90 "Premise: " + premise + "\n" + "Hypothesis: " + hypothesis
91 )
92 print("p =>", attacked_text_pair.printable_text())
93 print("d =>", desired_printed_pair_text)
94 assert attacked_text_pair.printable_text() == desired_printed_pair_text
95
96 def test_tokenizer_input(self, attacked_text, attacked_text_pair):
97 assert attacked_text.tokenizer_input == raw_text

Callers

nothing calls this directly

Calls 1

printable_textMethod · 0.80

Tested by

no test coverage detected