| @@ 143-155 (lines=13) @@ | ||
| 140 | return MockSession(name_format) |
|
| 141 | ||
| 142 | ||
| 143 | def make_logger(sess): |
|
| 144 | output = StringIO() |
|
| 145 | sess.logger = Namespace( |
|
| 146 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 147 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 148 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 149 | ) |
|
| 150 | sess.storage.logger = Namespace( |
|
| 151 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 152 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 153 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 154 | ) |
|
| 155 | return output |
|
| 156 | ||
| 157 | ||
| 158 | def test_rendering(sess): |
|
| @@ 137-149 (lines=13) @@ | ||
| 134 | return text |
|
| 135 | ||
| 136 | ||
| 137 | def make_logger(sess): |
|
| 138 | output = StringIO() |
|
| 139 | sess.logger = Namespace( |
|
| 140 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 141 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 142 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 143 | ) |
|
| 144 | sess.storage.logger = Namespace( |
|
| 145 | warn=lambda code, text, **opts: output.write(u"%s: %s %s\n" % (code, force_text(text), opts)), |
|
| 146 | info=lambda text, **opts: output.write(force_text(text) + u'\n'), |
|
| 147 | error=lambda text: output.write(force_text(text) + u'\n'), |
|
| 148 | ) |
|
| 149 | return output |
|
| 150 | ||
| 151 | ||
| 152 | @pytest.fixture |
|