Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rootfs/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
The **api** Django app presents a RESTful web API for interacting with the **deis** system.
"""

__version__ = '2.2.0'
__version__ = '2.3.0'
2 changes: 1 addition & 1 deletion rootfs/api/models/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def logs(self, log_lines=str(settings.LOG_LINES)):
raise ServiceUnavailable('Error accessing deis-logger')

# cast content to string since it comes as bytes via the requests object
return str(r.content)
return str(r.content.decode('utf-8'))

def run(self, user, command):
def pod_name(size=5, chars=string.ascii_lowercase + string.digits):
Expand Down
14 changes: 7 additions & 7 deletions rootfs/api/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def test_app_override_id(self, mock_requests):
self.assertContains(response, 'Application with this id already exists.', status_code=400)

@mock.patch('requests.get')
def test_app_actions(self, mock_requests, mock_get):
def test_app_logs(self, mock_requests, mock_get):
app_id = self.create_app()

# test logs - 204 from deis-logger
Expand All @@ -111,7 +111,8 @@ def test_app_actions(self, mock_requests, mock_get):
self.assertContains(
response,
"Error accessing logs for {}".format(app_id),
status_code=500)
status_code=500
)

# test logs - success accessing deis-logger
mock_response.status_code = 200
Expand All @@ -125,9 +126,8 @@ def test_app_actions(self, mock_requests, mock_get):
self.assertContains(
response,
"Error accessing logs for {}".format(app_id),
status_code=500)

# TODO: test run needs an initial build
status_code=500
)

@mock.patch('api.models.logger')
def test_app_release_notes_in_logs(self, mock_requests, mock_logger):
Expand Down Expand Up @@ -566,9 +566,9 @@ def test_get_private_registry_config_bad_registry_location(self, mock_requests):
self.assertEqual(create, None)


FAKE_LOG_DATA = """
FAKE_LOG_DATA = bytes("""
2013-08-15 12:41:25 [33454] [INFO] Starting gunicorn 17.5
2013-08-15 12:41:25 [33454] [INFO] Listening at: http://0.0.0.0:5000 (33454)
2013-08-15 12:41:25 [33454] [INFO] Using worker: sync
2013-08-15 12:41:25 [33457] [INFO] Booting worker with pid 33457
"""
""", 'utf-8')