[CMF-checkins] CVS: CMF/CMFDefault/tests - test_Link.py:1.2.2.1

Tres Seaver tseaver@zope.com
Mon, 10 Dec 2001 17:36:06 -0500


Update of /cvs-repository/CMF/CMFDefault/tests
In directory cvs.zope.org:/tmp/cvs-serv25479/CMFDefault/tests

Modified Files:
      Tag: CMF-1_2-branch
	test_Link.py 
Log Message:


  - Assorted Zope 2.3 compatibility hacks^H^H^H^H^Hfixes:

    o CatalogTool: Accomodate both versions of 'ZCatalog.catalog_object'
      (Zope 2.4 adds new 'idxs' argument).

    o PortalContent: test for present of WebDAV locking; patch around
      its absence in Zope 2.3.

    o TypesTool: patch around absence of named Unauthorized exception
      in Zope 2.3 and Zope 2.4.

    o Document: patch around absence of WebDAV locking in 2.3.

    o Link: patch around different return value (trailing slash) from
      Python 1.5.2's 'urlparse.urlunparse'.


=== CMF/CMFDefault/tests/test_Link.py 1.2 => 1.2.2.1 ===
         d._writeFromPUT( body=BASIC_STRUCTUREDTEXT )
         
-        self.failUnless( d.Title() == 'Zope Community' )
-        self.failUnless(
-                d.Description() == 'Link to the Zope Community website.' )
-        self.failUnless( len(d.Subject()) == 3 )
-        self.failUnless( d.getRemoteUrl() == 'http://www.zope.org' )
+        self.assertEqual( d.Title(), 'Zope Community' )
+        self.assertEqual(
+                d.Description(), 'Link to the Zope Community website.' )
+        self.assertEqual( len(d.Subject()), 3 )
+        self.assertEqual( d.getRemoteUrl(), 'http://www.zope.org' )
 
     def test_fixupMissingScheme( self ):
         d = Link( 'foo' )
         d.edit( 'http://foo.com' )
-        self.failUnless( d.getRemoteUrl() == 'http://foo.com' )
+        self.assertEqual( d.getRemoteUrl(), 'http://foo.com' )
 
         d = Link( 'bar' )
         d.edit( '//bar.com' )
-        self.failUnless( d.getRemoteUrl() == 'http://bar.com' )
+        self.assertEqual( d.getRemoteUrl(), 'http://bar.com' )
 
         d = Link( 'baz' )
         d.edit( 'baz.com' )
-        self.failUnless( d.getRemoteUrl() == 'http://baz.com' )
+        self.assertEqual( d.getRemoteUrl(), 'http://baz.com' )