[CMF-checkins] CVS: Products/CMFDefault/tests - test_Link.py:1.1 test_all.py:1.9
Tres Seaver
tseaver@zope.com
Tue, 30 Oct 2001 23:18:49 -0500
Update of /cvs-repository/Products/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv18201/tests
Modified Files:
test_all.py
Added Files:
test_Link.py
Log Message:
- Make Links editable via FTP/WebDAV.
=== Added File Products/CMFDefault/tests/test_Link.py ===
import unittest, string
from Products.CMFDefault.Link import Link
BASIC_STRUCTUREDTEXT = '''\
Title: Zope Community
Description: Link to the Zope Community website.
Subject: open source; Zope; community
http://ww.zope.org
'''
class LinkTests(unittest.TestCase):
def setUp( self ):
get_transaction().begin()
def tearDown( self ):
get_transaction().abort()
def test_Empty(self):
d = Link('foo')
assert d.Title() == ''
assert d.Description() == ''
assert d.getRemoteUrl() == ''
def test_StructuredText(self):
d = Link('foo')
d._writeFromPUT( body=BASIC_STRUCTUREDTEXT )
assert d.Title() == 'Zope Community'
assert d.Description() == 'Link to the Zope Community website.'
assert len(d.Subject()) == 3
def test_suite():
return unittest.makeSuite(LinkTests)
def main():
unittest.TextTestRunner().run(test_suite())
if __name__=='__main__': main()
=== Products/CMFDefault/tests/test_all.py 1.8 => 1.9 ===
from Products.CMFDefault.tests import test_Document
from Products.CMFDefault.tests import test_NewsItem
+from Products.CMFDefault.tests import test_Link
from Products.CMFDefault.tests import test_Image
from Products.CMFDefault.tests import test_MetadataTool
from Products.CMFDefault.tests import test_utils
@@ -15,6 +16,7 @@
suite.addTest( test_Discussions.test_suite() )
suite.addTest( test_Document.test_suite() )
suite.addTest( test_NewsItem.test_suite() )
+ suite.addTest( test_Link.test_suite() )
suite.addTest( test_Image.test_suite() )
suite.addTest( test_MetadataTool.test_suite() )
suite.addTest( test_utils.test_suite() )