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

Side by Side Diff: tools/push-to-trunk/test_scripts.py

Issue 180873010: Refactoring: Long option names in push and merge scripts. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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 | « tools/push-to-trunk/push_to_trunk.py ('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
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright 2013 the V8 project authors. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following 10 # copyright notice, this list of conditions and the following
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 "-r", "reviewer@chromium.org", 70 "-r", "reviewer@chromium.org",
71 ] 71 ]
72 72
73 73
74 def MakeOptions(s=0, l=None, f=False, m=True, r=None, c=None, a=None, 74 def MakeOptions(s=0, l=None, f=False, m=True, r=None, c=None, a=None,
75 status_password=None, revert_bleeding_edge=None, p=None): 75 status_password=None, revert_bleeding_edge=None, p=None):
76 """Convenience wrapper.""" 76 """Convenience wrapper."""
77 class Options(object): 77 class Options(object):
78 pass 78 pass
79 options = Options() 79 options = Options()
80 options.s = s 80 options.step = s
81 options.l = l 81 options.last_push = l
82 options.f = f 82 options.force = f
83 options.m = m 83 options.manual = m
84 options.reviewer = r 84 options.reviewer = r
85 options.c = c 85 options.chromium = c
86 options.a = a 86 options.author = a
87 options.p = p 87 options.push = p
88 options.status_password = status_password 88 options.status_password = status_password
89 options.revert_bleeding_edge = revert_bleeding_edge 89 options.revert_bleeding_edge = revert_bleeding_edge
90 return options 90 return options
91 91
92 92
93 class ToplevelTest(unittest.TestCase): 93 class ToplevelTest(unittest.TestCase):
94 def testMakeComment(self): 94 def testMakeComment(self):
95 self.assertEquals("# Line 1\n# Line 2\n#", 95 self.assertEquals("# Line 1\n# Line 2\n#",
96 MakeComment(" Line 1\n Line 2\n")) 96 MakeComment(" Line 1\n Line 2\n"))
97 self.assertEquals("#Line 1\n#Line 2", 97 self.assertEquals("#Line 1\n#Line 2",
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 options = merge_to_branch.BuildOptions().parse_args(args) 984 options = merge_to_branch.BuildOptions().parse_args(args)
985 self.assertTrue(merge_to_branch.ProcessOptions(options)) 985 self.assertTrue(merge_to_branch.ProcessOptions(options))
986 986
987 # The first run of the script stops because of the svn being down. 987 # The first run of the script stops because of the svn being down.
988 self.assertRaises(GitFailedException, 988 self.assertRaises(GitFailedException,
989 lambda: RunMergeToBranch(TEST_CONFIG, 989 lambda: RunMergeToBranch(TEST_CONFIG,
990 MergeToBranchOptions(options), 990 MergeToBranchOptions(options),
991 self)) 991 self))
992 992
993 # Test that state recovery after restarting the script works. 993 # Test that state recovery after restarting the script works.
994 options.s = 3 994 options.step = 3
995 RunMergeToBranch(TEST_CONFIG, MergeToBranchOptions(options), self) 995 RunMergeToBranch(TEST_CONFIG, MergeToBranchOptions(options), self)
996 996
997 997
998 class SystemTest(unittest.TestCase): 998 class SystemTest(unittest.TestCase):
999 def testReload(self): 999 def testReload(self):
1000 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={}, 1000 step = MakeStep(step_class=PrepareChangeLog, number=0, state={}, config={},
1001 options=CommonOptions(MakeOptions()), 1001 options=CommonOptions(MakeOptions()),
1002 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER) 1002 side_effect_handler=DEFAULT_SIDE_EFFECT_HANDLER)
1003 body = step.Reload( 1003 body = step.Reload(
1004 """------------------------------------------------------------------------ 1004 """------------------------------------------------------------------------
1005 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines 1005 r17997 | machenbach@chromium.org | 2013-11-22 11:04:04 +0100 (...) | 6 lines
1006 1006
1007 Prepare push to trunk. Now working on version 3.23.11. 1007 Prepare push to trunk. Now working on version 3.23.11.
1008 1008
1009 R=danno@chromium.org 1009 R=danno@chromium.org
1010 1010
1011 Review URL: https://codereview.chromium.org/83173002 1011 Review URL: https://codereview.chromium.org/83173002
1012 1012
1013 ------------------------------------------------------------------------""") 1013 ------------------------------------------------------------------------""")
1014 self.assertEquals( 1014 self.assertEquals(
1015 """Prepare push to trunk. Now working on version 3.23.11. 1015 """Prepare push to trunk. Now working on version 3.23.11.
1016 1016
1017 R=danno@chromium.org 1017 R=danno@chromium.org
1018 1018
1019 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body) 1019 Committed: https://code.google.com/p/v8/source/detail?r=17997""", body)
OLDNEW
« no previous file with comments | « tools/push-to-trunk/push_to_trunk.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698