diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-10-13 11:28:00 -0600 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2009-10-13 11:28:00 -0600 |
commit | f58ff2921defef330d53e08e427a82ced7585c88 (patch) | |
tree | c69823174d27be31d4488a331b3fde176f8e2679 /tests/test_ipawebui/test_controllers.py | |
parent | 1d6e23136a0664a86b765c67a9308f0951652f74 (diff) | |
download | freeipa.git-f58ff2921defef330d53e08e427a82ced7585c88.tar.gz freeipa.git-f58ff2921defef330d53e08e427a82ced7585c88.tar.xz freeipa.git-f58ff2921defef330d53e08e427a82ced7585c88.zip |
Giant webui patch take 2
Diffstat (limited to 'tests/test_ipawebui/test_controllers.py')
-rw-r--r-- | tests/test_ipawebui/test_controllers.py | 52 |
1 files changed, 3 insertions, 49 deletions
diff --git a/tests/test_ipawebui/test_controllers.py b/tests/test_ipawebui/test_controllers.py index e236d1a0..a08319b4 100644 --- a/tests/test_ipawebui/test_controllers.py +++ b/tests/test_ipawebui/test_controllers.py @@ -17,54 +17,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ -Test the `ipawebui.controller` module. +Test the `ipawebui.controllers` module. """ -from ipawebui import controller - - - -class test_Controller(object): - """ - Test the `controller.Controller` class. - """ - - def test_init(self): - """ - Test the `ipawebui.controller.Controller.__init__()` method. - """ - o = controller.Controller() - assert o.template is None - template = 'The template.' - o = controller.Controller(template) - assert o.template is template - - def test_output_xhtml(self): - """ - Test the `ipawebui.controller.Controller.output_xhtml` method. - """ - class Template(object): - def __init__(self): - self.calls = 0 - self.kw = {} - - def serialize(self, **kw): - self.calls += 1 - self.kw = kw - return dict(kw) - - d = dict(output='xhtml-strict', format='pretty') - t = Template() - o = controller.Controller(t) - assert o.output_xhtml() == d - assert t.calls == 1 - - def test_output_json(self): - """ - Test the `ipawebui.controller.Controller.output_json` method. - """ - o = controller.Controller() - assert o.output_json() == '{}' - e = '{\n "age": 27, \n "first": "John", \n "last": "Doe"\n}' - j = o.output_json(last='Doe', first='John', age=27) - assert j == e +from wsgiref import util +from wsgiref.validate import validator |