(self)
| 102 | self.assertEqual(t.values, ("Lys", 0, "GR")) |
| 103 | |
| 104 | def test_pickle_template(self): |
| 105 | user = 'test' |
| 106 | for template in ( |
| 107 | t'', |
| 108 | t"No values", |
| 109 | t'With inter {user}', |
| 110 | t'With ! {user!r}', |
| 111 | t'With format {1 / 0.3:.2f}', |
| 112 | Template(), |
| 113 | Template('a'), |
| 114 | Template(Interpolation('Nikita', 'name', None, '')), |
| 115 | Template('a', Interpolation('Nikita', 'name', 'r', '')), |
| 116 | ): |
| 117 | for proto in range(pickle.HIGHEST_PROTOCOL + 1): |
| 118 | with self.subTest(proto=proto, template=template): |
| 119 | pickled = pickle.dumps(template, protocol=proto) |
| 120 | unpickled = pickle.loads(pickled) |
| 121 | |
| 122 | self.assertEqual(unpickled.values, template.values) |
| 123 | self.assertEqual(fstring(unpickled), fstring(template)) |
| 124 | |
| 125 | def test_pickle_interpolation(self): |
| 126 | for interpolation in ( |
nothing calls this directly
no test coverage detected