Example #1
0
 def test_set_url(self):
     el = ExternalLink('[ftp://mediawiki.org mw]')
     el.url = 'https://www.mediawiki.org/'
     self.assertEqual('[https://www.mediawiki.org/ mw]', el.string)
     el = ExternalLink('ftp://mediawiki.org')
     el.url = 'https://www.mediawiki.org/'
     self.assertEqual('https://www.mediawiki.org/', el.string)
     el = ExternalLink('[ftp://mediawiki.org]')
     el.url = 'https://www.mediawiki.org/'
     self.assertEqual('[https://www.mediawiki.org/]', el.string)
def test_url_setter():
    el = ExternalLink('[ftp://mediawiki.org mw]')
    el.url = 'https://www.mediawiki.org/'
    assert '[https://www.mediawiki.org/ mw]' == el.string

    el = ExternalLink('ftp://mediawiki.org')
    el.url = 'https://www.mediawiki.org/'
    assert 'https://www.mediawiki.org/' == el.string

    el = ExternalLink('[ftp://mediawiki.org]')
    el.url = 'https://www.mediawiki.org/'
    assert '[https://www.mediawiki.org/]' == el.string