(self)
| 27 | class Sub(Interpolation): ... |
| 28 | |
| 29 | def test_basic_creation(self): |
| 30 | # Simple t-string creation |
| 31 | t = t'Hello, world' |
| 32 | self.assertIsInstance(t, Template) |
| 33 | self.assertTStringEqual(t, ('Hello, world',), ()) |
| 34 | self.assertEqual(fstring(t), 'Hello, world') |
| 35 | |
| 36 | # Empty t-string |
| 37 | t = t'' |
| 38 | self.assertTStringEqual(t, ('',), ()) |
| 39 | self.assertEqual(fstring(t), '') |
| 40 | |
| 41 | # Multi-line t-string |
| 42 | t = t"""Hello, |
| 43 | world""" |
| 44 | self.assertEqual(t.strings, ('Hello,\nworld',)) |
| 45 | self.assertEqual(len(t.interpolations), 0) |
| 46 | self.assertEqual(fstring(t), 'Hello,\nworld') |
| 47 | |
| 48 | def test_interpolation_creation(self): |
| 49 | i = Interpolation('Maria', 'name', 'a', 'fmt') |
nothing calls this directly
no test coverage detected