ovirt-node 2.2.0 release
[ovirt-node.git] / server / ovirtserver / tests / functional / test_root.py
blob5a7a55ef02648efb49b823b606d2aaad06997309
1 # Copyright (C) 2010, Red Hat, Inc.
2 # Written by Darryl L. Pierce
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 """
19 Functional test suite for the root controller.
21 This is an example of how functional tests can be written for controllers.
23 As opposed to a unit-test, which test a small unit of functionality,
24 functional tests exercise the whole application and its WSGI stack.
26 Please read http://pythonpaste.org/webtest/ for more information.
28 """
29 from nose.tools import assert_true
31 from ovirtserver.tests import TestController
34 class TestRootController(TestController):
35 def test_index(self):
36 response = self.app.get('/')
37 msg = 'TurboGears 2 is rapid web application development toolkit '\
38 'designed to make your life easier.'
39 # You can look for specific strings:
40 assert_true(msg in response)
42 # You can also access a BeautifulSoup'ed response in your tests
43 # (First run $ easy_install BeautifulSoup
44 # and then uncomment the next two lines)
46 #links = response.html.findAll('a')
47 #print links
48 #assert_true(links, "Mummy, there are no links here!")