Exemple #1
0
 def test_Empty(self):
     d = Link('foo')
     self.assertEqual(d.Title(), '')
     self.assertEqual(d.Description(), '')
     self.assertEqual(d.getRemoteUrl(), '')
     self.assertEqual(d.format, 'text/url')
     self.assertEqual(d.URL_FORMAT, 'text/url')
Exemple #2
0
 def test_StructuredText( self ):
     d = Link('foo')
     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' )
Exemple #3
0
 def test_PutWithoutMetadata(self):
     d = Link( 'foo' )
     d._writeFromPUT( body='' )
     self.assertEqual( d.Title(), '' )
     self.assertEqual( d.Format(), 'text/url' )
     self.assertEqual( d.Description(), '' )
     self.assertEqual( d.Subject(), () )
     self.assertEqual( d.Contributors(), () )
     self.assertEqual( d.EffectiveDate(), 'None' )
     self.assertEqual( d.ExpirationDate(), 'None' )
     self.assertEqual( d.Language(), '' )
     self.assertEqual( d.Rights(), '' )
Exemple #4
0
    def test_StructuredText_w_Continuation(self):

        d = Link('foo')
        d._writeFromPUT(body=STX_W_CONTINUATION)
        rnlinesplit = compile(r'\r?\n?')
        desc_lines = rnlinesplit.split(d.Description())

        self.assertEqual(d.Title(), 'Zope Community')
        self.assertEqual(desc_lines[0], 'Link to the Zope Community website,')
        self.assertEqual(desc_lines[1],
                         'including hundreds of contributed Zope products.')
        self.assertEqual(len(d.Subject()), 3)
        self.assertEqual(d.getRemoteUrl(), 'http://www.zope.org')
Exemple #5
0
    def test_Empty( self ):
        d = Link( 'foo' )
        self.assertEqual( d.Title(), '' )
        self.assertEqual( d.Description(), '' )
        self.assertEqual( d.getRemoteUrl(), '' )
        self.assertEqual( d.format, 'text/url' )
        self.assertEqual( d.URL_FORMAT, 'text/url')

        d = self._makeOne('foo', remote_url='bar')
        d.edit('')
        self.assertEqual(d.getRemoteUrl(), '')

        d = self._makeOne('foo', remote_url='http://')
        self.assertEqual(d.getRemoteUrl(), '')

        d = self._makeOne('foo', remote_url='http:')
        self.assertEqual(d.getRemoteUrl(), '')
Exemple #6
0
 def test_Empty( self ):
     d = Link( 'foo' )
     self.failUnless( d.Title() == '' )
     self.failUnless( d.Description() == '' )
     self.failUnless( d.getRemoteUrl() == '' )