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

Side by Side Diff: gmerge_test.py

Issue 6850002: Fix to replace current env with a blank one. (Closed) Base URL: http://git.chromium.org/git/dev-util.git@master
Patch Set: Created 9 years, 8 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 | no next file » | 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 1 #!/usr/bin/python
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 gmerge.""" 7 """Unit tests for gmerge."""
8 8
9 import gmerge 9 import gmerge
10 import os 10 import os
(...skipping 12 matching lines...) Expand all
23 'CHROMEOS_RELEASE_BOARD=x86-mario\r\n', 23 'CHROMEOS_RELEASE_BOARD=x86-mario\r\n',
24 'CHROMEOS_DEVSERVER=http://localhost:8080/\n'] 24 'CHROMEOS_DEVSERVER=http://localhost:8080/\n']
25 25
26 def testLsbRelease(self): 26 def testLsbRelease(self):
27 merger = gmerge.GMerger(self.lsb_release_lines) 27 merger = gmerge.GMerger(self.lsb_release_lines)
28 self.assertEqual({'CHROMEOS_RELEASE_BOARD': 'x86-mario', 28 self.assertEqual({'CHROMEOS_RELEASE_BOARD': 'x86-mario',
29 'CHROMEOS_DEVSERVER': 'http://localhost:8080/'}, 29 'CHROMEOS_DEVSERVER': 'http://localhost:8080/'},
30 merger.lsb_release) 30 merger.lsb_release)
31 31
32 def testPostData(self): 32 def testPostData(self):
33 original_use = os.environ.get('USE', '') 33 old_env = os.environ
34 os.environ = {}
34 os.environ['USE'] = 'a b c d +e' 35 os.environ['USE'] = 'a b c d +e'
35 gmerge.FLAGS = Flags({'accept_stable': 'blah'}) 36 gmerge.FLAGS = Flags({'accept_stable': 'blah'})
36 37
37 merger = gmerge.GMerger(self.lsb_release_lines) 38 merger = gmerge.GMerger(self.lsb_release_lines)
38 self.assertEqual( 39 self.assertEqual(
39 'use=a+b+c+d+%2Be&pkg=package_name&board=x86-mario&accept_stable=blah', 40 'use=a+b+c+d+%2Be&pkg=package_name&board=x86-mario&accept_stable=blah',
40 merger.GeneratePackageRequest('package_name')) 41 merger.GeneratePackageRequest('package_name'))
41 os.environ['USE'] = original_use 42 os.environ = old_env
42 43
43 44
44 if __name__ == '__main__': 45 if __name__ == '__main__':
45 unittest.main() 46 unittest.main()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698