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

Unified 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: Numerous code review fixes. Added --USE flag as well 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gmerge ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gmerge_test.py
diff --git a/gmerge_test.py b/gmerge_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..eab886c57f3b9a50b74dc1bce1817d7b973c98e7
--- /dev/null
+++ b/gmerge_test.py
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+
+# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Unit tests for gmerge."""
+
+import gmerge
+import unittest
+
+class Flags(object):
+ def __init__(self, dictionary):
+ self.__dict__.update(dictionary)
+
+
+class GMergeTest(unittest.TestCase):
+ """Test for gmerge."""
+
+ def setUp(self):
+ self.lsb_release_lines = [
+ 'CHROMEOS_RELEASE_BOARD=x86-mario\r\n',
+ 'CHROMEOS_DEVSERVER=http://localhost:8080/\n']
+
+ def testLsbRelease(self):
+ merger = gmerge.GMerger(self.lsb_release_lines)
+ self.assertEqual({'CHROMEOS_RELEASE_BOARD': 'x86-mario',
+ 'CHROMEOS_DEVSERVER': 'http://localhost:8080/'},
+ merger.lsb_release)
+
+ def testPostData(self):
+ gmerge.FLAGS = Flags({'use': 'a b c d +e',
+ 'accept_stable': 'blah'})
+
+ merger = gmerge.GMerger(self.lsb_release_lines)
+ self.assertEqual(
+ 'use=a+b+c+d+%2Be&pkg=package_name&board=x86-mario&accept_stable=blah',
+ merger.GeneratePackageRequest('package_name'))
+
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « gmerge ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698