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

Side by Side Diff: gmerge_test.py

Issue 6305004: Modify devserver and gmerge to be friendlier (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: Actually implement --use Created 9 years, 11 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
« gmerge ('K') | « gmerge ('k') | 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
(Empty)
1 #!/usr/bin/python
2
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
5 # found in the LICENSE file.
6
7 """Unit tests for gmerge."""
8
9 import gmerge
10 import unittest
11
12 class Flags(object):
13 def __init__(self, dictionary):
14 self.__dict__.update(dictionary)
15
16
17 class GMergeTest(unittest.TestCase):
18 """Test for gmerge."""
19
20 def setUp(self):
21 self.lsb_release_lines = [
22 'CHROMEOS_RELEASE_BOARD=x86-mario\r\n',
23 'CHROMEOS_DEVSERVER=http://localhost:8080/\n']
24
25 def testLsbRelease(self):
26 merger = gmerge.GMerger(self.lsb_release_lines)
27 self.assertEqual({'CHROMEOS_RELEASE_BOARD': 'x86-mario',
28 'CHROMEOS_DEVSERVER': 'http://localhost:8080/'},
29 merger.lsb_release)
30
31 def testPostData(self):
32 gmerge.FLAGS = Flags({'use': 'a b c d +e',
33 'accept_stable': 'blah'})
34
35 merger = gmerge.GMerger(self.lsb_release_lines)
36 self.assertEqual(
37 'use=a+b+c+d+%2Be&pkg=package_name&board=x86-mario&accept_stable=blah',
38 merger.GeneratePackageRequest('package_name'))
39
40
41 if __name__ == '__main__':
42 unittest.main()
OLDNEW
« gmerge ('K') | « gmerge ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698