Skip to content

Commit

Permalink
parse rawendpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
tardyp committed Sep 27, 2016
1 parent a493f8c commit aef24e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions master/buildbot/test/unit/test_util_raml.py
Expand Up @@ -81,3 +81,8 @@ def test_iter_actions(self):
build = self.api.endpoints_by_type['build']
actions = dict(self.api.iter_actions(build['/builds/{buildid}']))
self.assertEqual(sorted(actions.keys()), sorted(['rebuild', 'stop']))

def test_rawendpoints(self):
self.assertIn(
"/steps/{stepid}/logs/{log_slug}/raw",
self.api.rawendpoints.keys())
6 changes: 5 additions & 1 deletion master/buildbot/util/raml.py
Expand Up @@ -17,8 +17,8 @@
import os

import ramlfications

from future.utils import iteritems

try:
from collections import OrderedDict
except ImportError: # pragma: no cover
Expand All @@ -43,6 +43,7 @@ def __init__(self):
os.path.dirname(__file__), os.pardir, 'spec', 'api.raml'))
endpoints = {}
self.endpoints_by_type = {}
self.rawendpoints = {}
self.endpoints = self.parse_endpoints(endpoints, "", self.api)
self.types = self.parse_types()

Expand All @@ -66,6 +67,9 @@ def parse_endpoints(self, endpoints, base, api, uriParameters=None):
v['eptype'] = _is['bbget']['bbtype']
self.endpoints_by_type.setdefault(v['eptype'], {})
self.endpoints_by_type[v['eptype']][base] = api
if 'bbgetraw' in _is:
self.rawendpoints.setdefault(base, {})
self.rawendpoints[base] = api
return endpoints

def reindent(self, s, indent):
Expand Down

0 comments on commit aef24e6

Please sign in to comment.