2
# Copyright 2014 Canonical Ltd.
4
# This program is free software: you can redistribute it and/or modify it
5
# under the terms of the GNU Affero General Public License version 3, as
6
# published by the Free Software Foundation.
8
# This program is distributed in the hope that it will be useful, but
9
# WITHOUT ANY WARRANTY; without even the implied warranties of
10
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
# PURPOSE. See the GNU Affero General Public License for more details.
13
# You should have received a copy of the GNU Affero General Public License
14
# along with this program. If not, see <http://www.gnu.org/licenses/>.
16
"""Functional test suite for the non functional stats service.
18
You must have 'python3-webtest' installed to run these full-stack tests. To
19
run these tests, execute:
21
$ python3 -m unittest nfss.tests.functional
26
from webtest import TestApp
31
class FunctionalTests(unittest.TestCase):
34
self.testapp = TestApp(nfss.app)
36
def test_root_returns_405(self):
37
res = self.testapp.get('/', status=404)
38
self.assertEqual(res.status_code, 404)
40
def test_v1_api_sets_content_type(self):
41
res = self.testapp.get('/api/v1/')
42
self.assertEqual(res.content_type, 'application/json')