diff options
Diffstat (limited to 'lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_clients_tryclient.py')
-rw-r--r-- | lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_clients_tryclient.py | 135 |
1 files changed, 0 insertions, 135 deletions
diff --git a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_clients_tryclient.py b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_clients_tryclient.py deleted file mode 100644 index e4f61d3c..00000000 --- a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/test/unit/test_clients_tryclient.py +++ /dev/null @@ -1,135 +0,0 @@ -# This file is part of Buildbot. Buildbot is free software: you can -# redistribute it and/or modify it under the terms of the GNU General Public -# License as published by the Free Software Foundation, version 2. -# -# This program is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along with -# this program; if not, write to the Free Software Foundation, Inc., 51 -# Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright Buildbot Team Members - -from __future__ import with_statement - -from twisted.trial import unittest - -from buildbot.clients import tryclient -from buildbot.util import json - - -class createJobfile(unittest.TestCase): - - def makeNetstring(self, *strings): - return ''.join(['%d:%s,' % (len(s), s) for s in strings]) - - # version 1 is deprecated and not produced by the try client - - def test_createJobfile_v2_one_builder(self): - jobid = '123-456' - branch = 'branch' - baserev = 'baserev' - patch_level = 0 - patch_body = 'diff...' - repository = 'repo' - project = 'proj' - who = None - comment = None - builderNames = ['runtests'] - properties = {} - job = tryclient.createJobfile( - jobid, branch, baserev, patch_level, patch_body, repository, - project, who, comment, builderNames, properties) - jobstr = self.makeNetstring( - '2', jobid, branch, baserev, str(patch_level), patch_body, - repository, project, builderNames[0]) - self.assertEqual(job, jobstr) - - def test_createJobfile_v2_two_builders(self): - jobid = '123-456' - branch = 'branch' - baserev = 'baserev' - patch_level = 0 - patch_body = 'diff...' - repository = 'repo' - project = 'proj' - who = None - comment = None - builderNames = ['runtests', 'moretests'] - properties = {} - job = tryclient.createJobfile( - jobid, branch, baserev, patch_level, patch_body, repository, - project, who, comment, builderNames, properties) - jobstr = self.makeNetstring( - '2', jobid, branch, baserev, str(patch_level), patch_body, - repository, project, builderNames[0], builderNames[1]) - self.assertEqual(job, jobstr) - - def test_createJobfile_v3(self): - jobid = '123-456' - branch = 'branch' - baserev = 'baserev' - patch_level = 0 - patch_body = 'diff...' - repository = 'repo' - project = 'proj' - who = 'someuser' - comment = None - builderNames = ['runtests'] - properties = {} - job = tryclient.createJobfile( - jobid, branch, baserev, patch_level, patch_body, repository, - project, who, comment, builderNames, properties) - jobstr = self.makeNetstring( - '3', jobid, branch, baserev, str(patch_level), patch_body, - repository, project, who, builderNames[0]) - self.assertEqual(job, jobstr) - - def test_createJobfile_v4(self): - jobid = '123-456' - branch = 'branch' - baserev = 'baserev' - patch_level = 0 - patch_body = 'diff...' - repository = 'repo' - project = 'proj' - who = 'someuser' - comment = 'insightful comment' - builderNames = ['runtests'] - properties = {} - job = tryclient.createJobfile( - jobid, branch, baserev, patch_level, patch_body, repository, - project, who, comment, builderNames, properties) - jobstr = self.makeNetstring( - '4', jobid, branch, baserev, str(patch_level), patch_body, - repository, project, who, comment, builderNames[0]) - self.assertEqual(job, jobstr) - - def test_createJobfile_v5(self): - jobid = '123-456' - branch = 'branch' - baserev = 'baserev' - patch_level = 0 - patch_body = 'diff...' - repository = 'repo' - project = 'proj' - who = 'someuser' - comment = 'insightful comment' - builderNames = ['runtests'] - properties = {'foo': 'bar'} - job = tryclient.createJobfile( - jobid, branch, baserev, patch_level, patch_body, repository, - project, who, comment, builderNames, properties) - jobstr = self.makeNetstring( - '5', - json.dumps({ - 'jobid': jobid, 'branch': branch, 'baserev': baserev, - 'patch_level': patch_level, 'patch_body': patch_body, - 'repository': repository, 'project': project, 'who': who, - 'comment': comment, 'builderNames': builderNames, - 'properties': properties, - })) - self.assertEqual(job, jobstr) |