[Checkins] SVN: five.grok/branches/sylvain-zope213/src/five/grok/ Removed resources tests
Vincent Fretin
vincent.fretin at gmail.com
Sat Mar 5 05:02:59 EST 2011
Log message for revision 120761:
Removed resources tests
Changed:
D five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py
D five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py
U five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py
-=-
Deleted: five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py 2011-03-05 09:54:53 UTC (rev 120760)
+++ five.grok/branches/sylvain-zope213/src/five/grok/ftests/view/resource.py 2011-03-05 10:02:59 UTC (rev 120761)
@@ -1,115 +0,0 @@
-"""
- >>> from five.grok.ftests.view.resource import *
-
- >>> from Testing.testbrowser import Browser
- >>> browser = Browser()
- >>> browser.handleErrors = False
-
- We can access to our CSS file:
-
- >>> browser.open("http://localhost/++resource++five.grok.ftests.view/style.css")
- >>> print browser.contents
- body {
- color: green;
- }
- >>> print browser.headers['content-type']
- text/css; charset=iso-8859-15
-
- And the template file:
-
- >>> browser.open("http://localhost/++resource++five.grok.ftests.view/template.pt")
- >>> print browser.contents
- <tal:test>This template should be considered as a file.</tal:test>
- >>> print browser.headers['content-type']
- text/plain; charset=iso-8859-15
-
- Set a content, and ask the view on it. In a view, you should be able
- to get the resource URL:
-
- >>> id = getRootFolder()._setObject("manfred", Mammoth(id='manfred'))
- >>> browser.open("http://localhost/manfred")
- >>> print browser.contents
- <html>
- <body>
- <h1>Hello I a mammoth!</h1>
- <a href="http://localhost/manfred//++resource++five.grok.ftests.view/style.css">A link to some style for life!</a>
- </body>
- </html>
-
- We can use exists on resource files:
-
- >>> browser.open("http://localhost/manfred/exists")
- >>> print browser.contents
- <html>
- <body>
- <span>Test succeed</span>
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
- >>> browser.open("http://localhost/manfred/existsandtraverse")
- >>> print browser.contents
- <html>
- <body>
- <span>Test succeed</span>
- <BLANKLINE>
- </body>
- </html>
- <BLANKLINE>
-
-
-"""
-from five import grok
-
-class Mammoth(grok.Model):
-
- def __init__(self, id):
- super(Mammoth, self).__init__(id)
- self.id = id # XXX: if you don't have an id, the
- # link will be bad. Maybe this should
- # happens by default.
-
-class Index(grok.View):
- pass
-
-index = grok.PageTemplate("""\
-<html>
-<body>
-<h1>Hello I a mammoth!</h1>
-<a href="#"
- tal:attributes="href view/static/style.css">A link to some style for life!</a>
-</body>
-</html>
-""")
-
-
-class Exists(grok.View):
- pass
-
-exists = grok.PageTemplate("""\
-<html>
-<body>
-<span
- tal:condition="exists: view/static/style.css">Test succeed</span>
-<span
- tal:condition="exists: view/static/nonexistant.css">Test failed</span>
-</body>
-</html>
-""")
-
-
-class ExistsAndTraverse(grok.View):
- pass
-
-existsandtraverse = grok.PageTemplate("""\
-<html>
-<body>
-<span
- tal:condition="exists: context/++resource++five.grok.ftests.view/style.css">Test succeed</span>
-<span
- tal:condition="exists: context/++resource++five.grok.ftests.view/nonexistant.css">Test failed</span>
-</body>
-</html>
-""")
-
-
Deleted: five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py 2011-03-05 09:54:53 UTC (rev 120760)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/resource.py 2011-03-05 10:02:59 UTC (rev 120761)
@@ -1,19 +0,0 @@
-"""
-It is an error for the 'static' directory to be a python package:
-
- >>> from five.grok.tests.resource import *
- >>> grok.testing.grok('five.grok.tests.all.staticispackage')
- Traceback (most recent call last):
- ...
- GrokError: The 'static' resource directory must not be a python package.
-
-When a package contains a 'static' resource directory, it must not also contain
-a module called 'static.py':
-
- >>> grok.testing.grok('five.grok.tests.all.statichaspy')
- Traceback (most recent call last):
- ...
- GrokError: A package can not contain both a 'static' resource directory and a module named 'static.py'
-"""
-
-from five import grok
Modified: five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py
===================================================================
--- five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py 2011-03-05 09:54:53 UTC (rev 120760)
+++ five.grok/branches/sylvain-zope213/src/five/grok/tests/test_all.py 2011-03-05 10:02:59 UTC (rev 120761)
@@ -26,7 +26,7 @@
suite = unittest.TestSuite()
for name in ['adapters', 'annotation', 'multiadapter', 'utilities',
- 'subscribers', 'resource']:
+ 'subscribers']:
test = FunctionalDocTestSuite(
module='five.grok.tests.%s' % name,
optionflags=options)
More information about the checkins
mailing list