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

Side by Side Diff: third_party/buildbot_7_12/buildbot/test/test_changemaster.py

Issue 12207158: Bye bye buildbot 0.7.12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 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
OLDNEW
(Empty)
1 # -*- test-case-name: buildbot.test.test_changemaster -*-
2
3 from twisted.trial import unittest
4
5 from buildbot.changes.changes import *
6
7 class _DummyParent:
8 def __init__(self):
9 self.changes = []
10 def addChange(self, change):
11 self.changes.append(change)
12
13 def addService(self, child):
14 pass
15
16 class TestMaster(unittest.TestCase):
17 def testAddChange(self):
18 parent = _DummyParent()
19 master = TestChangeMaster()
20 master.setServiceParent(parent)
21
22 change = Change('user', [], 'comments')
23
24 master.addChange(change)
25
26 self.failUnlessEqual(parent.changes, [change])
27
28 def testChangeHorizon(self):
29 parent = _DummyParent()
30 master = TestChangeMaster()
31 master.setServiceParent(parent)
32 master.changeHorizon = 3
33
34 changes = []
35 for i in range(4):
36 change = Change('user', [], 'comment %i' % i)
37 master.addChange(change)
38 changes.append(change)
39
40 changes = changes[-3:]
41
42 self.failUnlessEqual(master.changes, changes)
43
44 def testNoChangeHorizon(self):
45 parent = _DummyParent()
46 master = TestChangeMaster()
47 master.setServiceParent(parent)
48 master.changeHorizon = 0
49
50 changes = []
51 for i in range(4):
52 change = Change('user', [], 'comment %i' % i)
53 master.addChange(change)
54 changes.append(change)
55
56 changes = changes[:]
57
58 self.failUnlessEqual(master.changes, changes)
OLDNEW
« no previous file with comments | « third_party/buildbot_7_12/buildbot/test/test_buildstep.py ('k') | third_party/buildbot_7_12/buildbot/test/test_changes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698