~unity-2d-team/unity-2d/Shell-MultiMonitor

13 by William Grant
Test add_message a little.
1
# Copyright (c) 2012 Canonical Ltd
7 by William Grant
Add trivial WSGI app and test.
2
#
3
# This program is free software: you can redistribute it and/or modify
4
# it under the terms of the GNU Affero General Public License as published by
5
# the Free Software Foundation, either version 3 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU Affero General Public License for more details.
12
#
13
# You should have received a copy of the GNU Affero General Public
14
# License along with this program. If not, see
15
# <http://www.gnu.org/licenses/>.
16
17
__metaclass__ = type
18
19
from unittest import TestCase
20
21
from webtest import TestApp
22
21 by William Grant
Merge grackle.server into grackle. Alter Makefile to run all the tests.
23
from grackle.wsgi import app
7 by William Grant
Add trivial WSGI app and test.
24
25
26
class TestRoot(TestCase):
27
28
    def test_get(self):
29
        test_app = TestApp(app.wsgifunc())
30
        r = test_app.get('/')
31
        self.assertEqual(200, r.status_int)
32
        r.mustcontain('Service endpoint for Grackle.')
33
34
35
class TestArchive(TestCase):
36
37
    def test_get(self):
38
        test_app = TestApp(app.wsgifunc())
39
        r = test_app.get('/archive/foo')
40
        self.assertEqual(200, r.status_int)
41
        r.mustcontain('Service for archive foo.')