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

Side by Side Diff: third_party/buildbot_7_12/buildbot/test/test_sourcestamp.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_sourcestamp -*-
2
3 from twisted.trial import unittest
4
5 from buildbot.sourcestamp import SourceStamp
6 from buildbot.changes.changes import Change
7
8 class SourceStampTest(unittest.TestCase):
9 def testAsDictEmpty(self):
10 EXPECTED = {
11 'revision': None,
12 'branch': None,
13 'hasPatch': False,
14 'changes': [],
15 }
16 self.assertEqual(EXPECTED, SourceStamp().asDict())
17
18 def testAsDictBranch(self):
19 EXPECTED = {
20 'revision': 'Rev',
21 'branch': 'Br',
22 'hasPatch': False,
23 'changes': [],
24 }
25 self.assertEqual(EXPECTED,
26 SourceStamp(branch='Br', revision='Rev').asDict())
27
28 def testAsDictChanges(self):
29 changes = [
30 Change('nobody', [], 'Comment', branch='br2', revision='rev2'),
31 Change('nob', ['file2', 'file3'], 'Com', branch='br3',
32 revision='rev3'),
33 ]
34 s = SourceStamp(branch='Br', revision='Rev', patch='Pat',
35 changes=changes)
36 r = s.asDict()
37 del r['changes'][0]['when']
38 del r['changes'][1]['when']
39 EXPECTED = {
40 'revision': 'rev3',
41 'branch': 'br3',
42 'hasPatch': True,
43 'changes': [
44 {
45 'branch': 'br2',
46 'category': None,
47 'comments': 'Comment',
48 'files': [],
49 'number': None,
50 'properties': [],
51 'revision': 'rev2',
52 'revlink': '',
53 'who': 'nobody'
54 },
55 {
56 'branch': 'br3',
57 'category': None,
58 'comments': 'Com',
59 'files': ['file2', 'file3'],
60 'number': None,
61 'properties': [],
62 'revision': 'rev3',
63 'revlink': '',
64 'who': 'nob'
65 }
66 ],
67 }
68 self.assertEqual(EXPECTED, r)
69
70 # vim: set ts=4 sts=4 sw=4 et:
OLDNEW
« no previous file with comments | « third_party/buildbot_7_12/buildbot/test/test_slaves.py ('k') | third_party/buildbot_7_12/buildbot/test/test_status.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698