Entry point for rpc server, view templates, rss feeds of node down times,
[monitor.git] / web / MonitorWeb / monitorweb / tests / test_controllers.py
1 import unittest
2 import turbogears
3 from turbogears import testutil
4 from monitorweb.controllers import Root
5 import cherrypy
6
7 cherrypy.root = Root()
8
9 class TestPages(unittest.TestCase):
10
11     def setUp(self):
12         turbogears.startup.startTurboGears()
13
14     def tearDown(self):
15         """Tests for apps using identity need to stop CP/TG after each test to
16         stop the VisitManager thread.
17         See http://trac.turbogears.org/turbogears/ticket/1217 for details.
18         """
19         turbogears.startup.stopTurboGears()
20
21     def test_method(self):
22         "the index method should return a string called now"
23         import types
24         result = testutil.call(cherrypy.root.index)
25         assert type(result["now"]) == types.StringType
26
27     def test_indextitle(self):
28         "The indexpage should have the right title"
29         testutil.create_request("/")
30         response = cherrypy.response.body[0].lower()
31         assert "<title>welcome to turbogears</title>" in response
32