Skip to content

Commit

Permalink
Merge branch 'release/3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
miltontony committed Feb 29, 2016
2 parents c73d329 + 10c1484 commit f00ef6c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
@@ -1,5 +1,9 @@
CHANGELOG
=========
3.2.0
-----
- add marathon info to health check

3.1.4
-----
- redirect to 'next' GET parameter when changing language
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
3.1.4
3.2.0
14 changes: 13 additions & 1 deletion springboard/tests/test_views.py
@@ -1,4 +1,7 @@
import mock
import json

from os import environ

from datetime import datetime

Expand Down Expand Up @@ -40,7 +43,16 @@ def test_index_view(self):

def test_health(self):
app = self.mk_app(self.workspace, settings=self.settings)
app.get('/health/', status=200)
environ['MARATHON_APP_ID'] = 'marathon-app-id'
environ['MARATHON_APP_VERSION'] = 'marathon-app-version'
resp = app.get('/health/', status=200)
data = json.loads(resp.body)
self.assertEqual(data, {
'id': 'marathon-app-id',
'version': 'marathon-app-version',
})
environ.pop('MARATHON_APP_ID')
environ.pop('MARATHON_APP_VERSION')

def test_category(self):
[category] = self.mk_categories(self.workspace, count=1)
Expand Down
6 changes: 5 additions & 1 deletion springboard/views/core.py
@@ -1,3 +1,5 @@
from os import environ

from pyramid.view import view_config
from pyramid.view import notfound_view_config
from pyramid.httpexceptions import HTTPFound
Expand All @@ -21,7 +23,9 @@ def index_view(self):

@view_config(route_name='health', renderer='json')
def health(self):
return {}
app_id = environ.get('MARATHON_APP_ID', None)
ver = environ.get('MARATHON_APP_VERSION', None)
return {'id': app_id, 'version': ver}

@ga_context(lambda context: {'dt': context['category'].title, })
@view_config(route_name='category',
Expand Down

0 comments on commit f00ef6c

Please sign in to comment.