"""
Unit tests for the app status view.

:copyright: Copyright 2013-2017, Dorian Pula <dorian.pula@amber-penguin-software.ca>
:license: AGPL v3+
"""

import http
from unittest import mock

import requests

import rookeries


def test_app_status_view_returns_app_info_as_a_json(api_base_uri):
    expected_info = {
        'app': 'rookeries',
        'version': rookeries.__version__,
        'gitRevision': mock.ANY,
    }

    actual = requests.get(f'{api_base_uri}/status')

    assert actual.status_code == http.HTTPStatus.OK
    assert actual.json() == expected_info
