summaryrefslogtreecommitdiffstats
path: root/ipa-server/ipa-gui/ipagui/tests
diff options
context:
space:
mode:
authorkmccarth@dhcp-172-16-25-136.sfbay.redhat.com <kmccarth@dhcp-172-16-25-136.sfbay.redhat.com>2007-08-12 04:53:18 -0700
committerkmccarth@dhcp-172-16-25-136.sfbay.redhat.com <kmccarth@dhcp-172-16-25-136.sfbay.redhat.com>2007-08-12 04:53:18 -0700
commit728e44833cebeb75f8a0035af7d4dd1b2924b75d (patch)
tree299d47464b1a617c8d0800f7ed10e2e098b9edf7 /ipa-server/ipa-gui/ipagui/tests
parenta3e786e22ec9d4b0e7d2ef982ac045a29477433e (diff)
downloadfreeipa-728e44833cebeb75f8a0035af7d4dd1b2924b75d.tar.gz
freeipa-728e44833cebeb75f8a0035af7d4dd1b2924b75d.tar.xz
freeipa-728e44833cebeb75f8a0035af7d4dd1b2924b75d.zip
Addiing initial turbogears web gui.
Contains simple user add, list, and view pages.
Diffstat (limited to 'ipa-server/ipa-gui/ipagui/tests')
-rw-r--r--ipa-server/ipa-gui/ipagui/tests/test_controllers.py32
-rw-r--r--ipa-server/ipa-gui/ipagui/tests/test_model.py22
2 files changed, 54 insertions, 0 deletions
diff --git a/ipa-server/ipa-gui/ipagui/tests/test_controllers.py b/ipa-server/ipa-gui/ipagui/tests/test_controllers.py
new file mode 100644
index 000000000..b9b4f5c5c
--- /dev/null
+++ b/ipa-server/ipa-gui/ipagui/tests/test_controllers.py
@@ -0,0 +1,32 @@
+import unittest
+import turbogears
+from turbogears import testutil
+from ipagui.controllers import Root
+import cherrypy
+
+cherrypy.root = Root()
+
+class TestPages(unittest.TestCase):
+
+ def setUp(self):
+ turbogears.startup.startTurboGears()
+
+ def tearDown(self):
+ """Tests for apps using identity need to stop CP/TG after each test to
+ stop the VisitManager thread.
+ See http://trac.turbogears.org/turbogears/ticket/1217 for details.
+ """
+ turbogears.startup.stopTurboGears()
+
+ def test_method(self):
+ "the index method should return a string called now"
+ import types
+ result = testutil.call(cherrypy.root.index)
+ assert type(result["now"]) == types.StringType
+
+ def test_indextitle(self):
+ "The indexpage should have the right title"
+ testutil.createRequest("/")
+ response = cherrypy.response.body[0].lower()
+ assert "<title>welcome to turbogears</title>" in response
+
diff --git a/ipa-server/ipa-gui/ipagui/tests/test_model.py b/ipa-server/ipa-gui/ipagui/tests/test_model.py
new file mode 100644
index 000000000..bd0db4c70
--- /dev/null
+++ b/ipa-server/ipa-gui/ipagui/tests/test_model.py
@@ -0,0 +1,22 @@
+# If your project uses a database, you can set up database tests
+# similar to what you see below. Be sure to set the db_uri to
+# an appropriate uri for your testing database. sqlite is a good
+# choice for testing, because you can use an in-memory database
+# which is very fast.
+
+from turbogears import testutil, database
+# from ipagui.model import YourDataClass, User
+
+# database.set_db_uri("sqlite:///:memory:")
+
+# class TestUser(testutil.DBTest):
+# def get_model(self):
+# return User
+# def test_creation(self):
+# "Object creation should set the name"
+# obj = User(user_name = "creosote",
+# email_address = "spam@python.not",
+# display_name = "Mr Creosote",
+# password = "Wafer-thin Mint")
+# assert obj.display_name == "Mr Creosote"
+