| 158 | assert len(output_spy.flush()) == 1 |
| 159 | |
| 160 | def test_outputbuffer_batch(self, output_spy): |
| 161 | out = self.OutputBuffer() |
| 162 | # visible: all |
| 163 | output_spy.begin() |
| 164 | out.level = 'info' |
| 165 | out.batch = False |
| 166 | out.info('info color') |
| 167 | out.head('head color') |
| 168 | out.good('good color') |
| 169 | out.warn('warn color') |
| 170 | out.fail('fail color') |
| 171 | out.write() |
| 172 | assert len(output_spy.flush()) == 5 |
| 173 | # visible: all except head |
| 174 | output_spy.begin() |
| 175 | out.level = 'info' |
| 176 | out.batch = True |
| 177 | out.info('info color') |
| 178 | out.head('head color') |
| 179 | out.good('good color') |
| 180 | out.warn('warn color') |
| 181 | out.fail('fail color') |
| 182 | out.write() |
| 183 | assert len(output_spy.flush()) == 4 |