MCPcopy
hub / github.com/jtesta/ssh-audit / test_outputbuffer_level

Method test_outputbuffer_level

test/test_outputbuffer.py:117–158  ·  view source on GitHub ↗
(self, output_spy)

Source from the content-addressed store, hash-verified

115 assert out.level == 'unknown'
116
117 def test_outputbuffer_level(self, output_spy):
118 out = self.OutputBuffer()
119 # visible: all
120 out.level = 'info'
121 output_spy.begin()
122 out.info('info color')
123 out.head('head color')
124 out.good('good color')
125 out.warn('warn color')
126 out.fail('fail color')
127 out.write()
128 assert len(output_spy.flush()) == 5
129 # visible: head, warn, fail
130 out.level = 'warn'
131 output_spy.begin()
132 out.info('info color')
133 out.head('head color')
134 out.good('good color')
135 out.warn('warn color')
136 out.fail('fail color')
137 out.write()
138 assert len(output_spy.flush()) == 3
139 # visible: head, fail
140 out.level = 'fail'
141 output_spy.begin()
142 out.info('info color')
143 out.head('head color')
144 out.good('good color')
145 out.warn('warn color')
146 out.fail('fail color')
147 out.write()
148 assert len(output_spy.flush()) == 2
149 # visible: head
150 out.level = 'invalid level'
151 output_spy.begin()
152 out.info('info color')
153 out.head('head color')
154 out.good('good color')
155 out.warn('warn color')
156 out.fail('fail color')
157 out.write()
158 assert len(output_spy.flush()) == 1
159
160 def test_outputbuffer_batch(self, output_spy):
161 out = self.OutputBuffer()

Callers

nothing calls this directly

Calls 8

infoMethod · 0.95
headMethod · 0.95
goodMethod · 0.95
warnMethod · 0.95
failMethod · 0.95
writeMethod · 0.95
beginMethod · 0.80
flushMethod · 0.80

Tested by

no test coverage detected