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

Side by Side Diff: tests/bitmaps/TestBmpBlock.py

Issue 6534025: Correctly handle reuse of screens in yaml file. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git@master
Patch Set: Fix indentation Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/bitmaps/case_reuse.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python -tt 1 #!/usr/bin/python -tt
2 # 2 #
3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Unit tests for bmpblk_utility. 7 """Unit tests for bmpblk_utility.
8 """ 8 """
9 9
10 import os 10 import os
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 self.assertEqual(0, rc) 127 self.assertEqual(0, rc)
128 rc, out, err = runprog(prog, '-c', 'case_order2.yaml', 'ORDER2') 128 rc, out, err = runprog(prog, '-c', 'case_order2.yaml', 'ORDER2')
129 self.assertEqual(0, rc) 129 self.assertEqual(0, rc)
130 rc, out, err = runprog('/usr/bin/cmp', 'ORDER1', 'ORDER2') 130 rc, out, err = runprog('/usr/bin/cmp', 'ORDER1', 'ORDER2')
131 self.assertEqual(0, rc) 131 self.assertEqual(0, rc)
132 132
133 def tearDown(self): 133 def tearDown(self):
134 rc, out, err = runprog('/bin/rm', '-f', 'ORDER1', 'ORDER2') 134 rc, out, err = runprog('/bin/rm', '-f', 'ORDER1', 'ORDER2')
135 self.assertEqual(0, rc) 135 self.assertEqual(0, rc)
136 136
137 class TestReuse(unittest.TestCase):
138
139 def setUp(self):
140 rc, out, err = runprog('/bin/rm', '-rf', './FOO_DIR', 'FOO')
141 self.assertEqual(0, rc)
142
143 def testReuse(self):
144 """Reusing screens in the yaml file should be okay"""
145 rc, out, err = runprog(prog, '-c', 'case_reuse.yaml', 'FOO')
146 self.assertEqual(0, rc)
147 rc, out, err = runprog(prog, '-x', '-d', './FOO_DIR', 'FOO')
148 self.assertEqual(0, rc)
149 os.chdir('./FOO_DIR')
150 rc, out, err = runprog(prog, '-c', 'config.yaml', 'BAR')
151 self.assertEqual(0, rc)
152 rc, out, err = runprog('/usr/bin/cmp', '../FOO', 'BAR')
153 self.assertEqual(0, rc)
154 os.chdir('..')
155
156 def tearDown(self):
157 rc, out, err = runprog('/bin/rm', '-rf', './FOO_DIR', 'FOO')
158 self.assertEqual(0, rc)
159
137 160
138 # Run these tests 161 # Run these tests
139 if __name__ == '__main__': 162 if __name__ == '__main__':
140 varname = 'BMPBLK' 163 varname = 'BMPBLK'
141 if varname not in os.environ: 164 if varname not in os.environ:
142 print('You must specify the path to bmpblk_utility in the $%s ' 165 print('You must specify the path to bmpblk_utility in the $%s '
143 'environment variable.' % varname) 166 'environment variable.' % varname)
144 sys.exit(1) 167 sys.exit(1)
145 prog = os.environ[varname] 168 prog = os.environ[varname]
146 print "Testing prog...", prog 169 print "Testing prog...", prog
147 unittest.main() 170 unittest.main()
148 171
OLDNEW
« no previous file with comments | « no previous file | tests/bitmaps/case_reuse.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698