Skip to content

Commit

Permalink
Merge tardyp/buildbot:restreg (PR #1602)
Browse files Browse the repository at this point in the history
(with addition of a space)
  • Loading branch information
djmitche committed Mar 17, 2015
2 parents 48c8bca + 5117b02 commit 02195a3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions master/buildbot/data/base.py
Expand Up @@ -88,6 +88,9 @@ def control(self, action, args, kwargs):
def startConsuming(self, callback, options, kwargs):
raise NotImplementedError

def __repr__(self):
return "endpoint for " + self.pathPatterns


class BuildNestingMixin(object):

Expand Down
4 changes: 4 additions & 0 deletions master/buildbot/data/resultspec.py
Expand Up @@ -75,6 +75,10 @@ def __init__(self, filters=None, fields=None, order=None,
self.limit = limit
self.offset = offset

def __repr__(self):
return "ResultSpec(**" + repr(dict(filters=self.filters, fields=self.fields, order=self.order,
limit=self.limit, offset=self.offset)) + ")"

def popFilter(self, field, op):
for f in self.filters:
if f.field == field and f.op == op:
Expand Down
4 changes: 3 additions & 1 deletion master/buildbot/test/unit/test_www_rest.py
Expand Up @@ -452,7 +452,9 @@ def test_api_details(self):
def test_api_details_none(self):
yield self.render_resource(self.rsrc, '/test/0')
self.assertRequest(
contentJson=dict(error="not found"),
contentJson=dict(error="not found while getting from endpoint for /test/n:testid with arguments"
" ResultSpec(**{'fields': None, 'limit': None, 'order': None, 'filters': [], "
"'offset': None}) and {'testid': 0}"),
contentType='text/plain; charset=utf-8',
responseCode=404)

Expand Down
6 changes: 3 additions & 3 deletions master/buildbot/www/rest.py
Expand Up @@ -308,9 +308,9 @@ def writeError(msg, errcode=404, jsonrpccode=None):
rspec = self.decodeResultSpec(request, ep)
data = yield ep.get(rspec, kwargs)
if data is None:
writeError(("not found while getting from endpoint %s with "
"arguments %s and %s") % (str(ep), str(rspec),
str(kwargs)), errcode=404)
writeError(("not found while getting from %s with "
"arguments %s and %s") % (repr(ep), repr(rspec),
str(kwargs)), errcode=404)
return

if ep.isRaw:
Expand Down

0 comments on commit 02195a3

Please sign in to comment.