Mercurial > genshi > mirror
annotate examples/turbogears/genshitest/tests/test_controllers.py @ 814:a5c74a9b9782 trunk
Remove unneeded conversion of empty attribute values into a single-item list of an empty `TEXT` event.
author | cmlenz |
---|---|
date | Mon, 09 Mar 2009 14:04:21 +0000 |
parents | 84168828b074 |
children |
rev | line source |
---|---|
4
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
1 from turbogears import testutil |
230 | 2 from genshitest.controllers import Root |
4
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
3 import cherrypy |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
4 |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
5 cherrypy.root = Root() |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
6 |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
7 def test_method(): |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
8 "the index method should return a string called now" |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
9 import types |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
10 result = testutil.call(cherrypy.root.index) |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
11 assert type(result["now"]) == types.StringType |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
12 |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
13 def test_indextitle(): |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
14 "The mainpage should have the right title" |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
15 testutil.createRequest("/") |
49364e784c47
Added first stab of an implementation of the !TurboGears [http://www.turbogears.org/docs/plugins/template.html plugin API for template engines], and also a !TurboGears-based example using this plugin. Both written by Matt Good.
cmlenz
parents:
diff
changeset
|
16 assert "<TITLE>Welcome to TurboGears</TITLE>" in cherrypy.response.body[0] |