Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(589)

Side by Side Diff: recipe_engine/unittests/stream_test.py

Issue 2934583003: [step] Remove config indirection. (Closed)
Patch Set: fix test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The LUCI Authors. All rights reserved. 2 # Copyright 2015 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 import cStringIO 6 import cStringIO
7 import unittest 7 import unittest
8 8
9 import test_env 9 import test_env
10 10
(...skipping 19 matching lines...) Expand all
30 foo.trigger('{"builderName":["bar\'s fantasies"]}') 30 foo.trigger('{"builderName":["bar\'s fantasies"]}')
31 foo.close() 31 foo.close()
32 32
33 # TODO(luqui): N.B. stream interleaving is not really possible with 33 # TODO(luqui): N.B. stream interleaving is not really possible with
34 # subannotations, since the subannotator stream could have changed the 34 # subannotations, since the subannotator stream could have changed the
35 # active step. To do this right we would need to parse and re-emit 35 # active step. To do this right we would need to parse and re-emit
36 # subannotations. 36 # subannotations.
37 bars_baby = engine.make_step_stream( 37 bars_baby = engine.make_step_stream(
38 'bar\'s baby', 38 'bar\'s baby',
39 allow_subannotations=True, 39 allow_subannotations=True,
40 step_nest_level=1) 40 nest_level=1)
41 bars_baby.write_line('I\'m in bar\'s imagination!!') 41 bars_baby.write_line('I\'m in bar\'s imagination!!')
42 bars_baby.write_line('@@@STEP_WARNINGS@@@') 42 bars_baby.write_line('@@@STEP_WARNINGS@@@')
43 bars_baby.reset_subannotation_state() 43 bars_baby.reset_subannotation_state()
44 bars_baby.close() 44 bars_baby.close()
45 45
46 bar.set_build_property('is_babycrazy', 'true') 46 bar.set_build_property('is_babycrazy', 'true')
47 bar.write_line('bar tries to kiss foo, but foo already left') 47 bar.write_line('bar tries to kiss foo, but foo already left')
48 bar.write_line('@@@KISS@foo@@@') 48 bar.write_line('@@@KISS@foo@@@')
49 bar.set_step_status('EXCEPTION') 49 bar.set_step_status('EXCEPTION')
50 bar.close() 50 bar.close()
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 def test_buildbot_status_constraint(self): 157 def test_buildbot_status_constraint(self):
158 with stream.StreamEngineInvariants() as engine: 158 with stream.StreamEngineInvariants() as engine:
159 foo = engine.make_step_stream('foo') 159 foo = engine.make_step_stream('foo')
160 foo.set_step_status('FAILURE') 160 foo.set_step_status('FAILURE')
161 with self.assertRaises(AssertionError): 161 with self.assertRaises(AssertionError):
162 foo.set_step_status('SUCCESS') 162 foo.set_step_status('SUCCESS')
163 163
164 if __name__ == '__main__': 164 if __name__ == '__main__':
165 unittest.main() 165 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698