MCPcopy Index your code
hub / github.com/python/cpython / assertTStringEqual

Method assertTStringEqual

Lib/test/test_string/_support.py:30–43  ·  view source on GitHub ↗

Test template string literal equality. The *strings* argument must be a tuple of strings equal to *t.strings*. The *interpolations* argument must be a sequence of tuples which are compared against *t.interpolations*. Each tuple must match the form described in the `

(self, t, strings, interpolations)

Source from the content-addressed store, hash-verified

28 self.assertEqual(i.format_spec, "")
29
30 def assertTStringEqual(self, t, strings, interpolations):
31 """Test template string literal equality.
32
33 The *strings* argument must be a tuple of strings equal to *t.strings*.
34
35 The *interpolations* argument must be a sequence of tuples which are
36 compared against *t.interpolations*. Each tuple must match the form
37 described in the `assertInterpolationEqual` method.
38 """
39 self.assertEqual(t.strings, strings)
40 self.assertEqual(len(t.interpolations), len(interpolations))
41
42 for i, exp in zip(t.interpolations, interpolations, strict=True):
43 self.assertInterpolationEqual(i, exp)
44
45
46def convert(value, conversion):

Callers 10

test_conversionsMethod · 0.80
test_debug_specifierMethod · 0.80
test_raw_tstringsMethod · 0.80
test_triple_quotedMethod · 0.80
test_basic_creationMethod · 0.80

Calls 2

assertEqualMethod · 0.45

Tested by 10

test_conversionsMethod · 0.64
test_debug_specifierMethod · 0.64
test_raw_tstringsMethod · 0.64
test_triple_quotedMethod · 0.64
test_basic_creationMethod · 0.64