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

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

Issue 2702313003: Remove unused imports and fix some other linter errors. (Closed)
Patch Set: Created 3 years, 10 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 2013 The LUCI Authors. All rights reserved. 2 # Copyright 2013 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 os 6 import os
7 import shutil
8 import sys 7 import sys
9 import tempfile
10 import unittest 8 import unittest
11 9
12 sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname( 10 sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(
13 os.path.abspath(__file__))))) 11 os.path.abspath(__file__)))))
14 12
15 from recipe_engine import field_composer 13 from recipe_engine import field_composer
16 14
17 15
18 # Functors are compared by reference. 16 # Functors are compared by reference.
19 BEAUTY_LAMBDA = lambda x, y: x + y + 1 17 BEAUTY_LAMBDA = lambda x, y: x + y + 1
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 def test_compose_with_sneaky_bad_registry(self): 71 def test_compose_with_sneaky_bad_registry(self):
74 """RegistryConflict must be raised when functors clash.""" 72 """RegistryConflict must be raised when functors clash."""
75 second_fc = field_composer.FieldComposer( 73 second_fc = field_composer.FieldComposer(
76 {}, {'beauty': {'combine': lambda x, y: 0}}) 74 {}, {'beauty': {'combine': lambda x, y: 0}})
77 with self.assertRaises(field_composer.RegistryConflict): 75 with self.assertRaises(field_composer.RegistryConflict):
78 self.fc.compose(second_fc) 76 self.fc.compose(second_fc)
79 77
80 78
81 if __name__ == '__main__': 79 if __name__ == '__main__':
82 unittest.main() 80 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698