Merge pull request #1110 from tshepang/deprecated

replace Deprecated method; use unittest.mock when available
This commit is contained in:
Justin Mayer 2013-10-07 03:06:11 -07:00
commit 9ebe06156c
2 changed files with 13 additions and 10 deletions

View file

@ -193,17 +193,17 @@ class TestPage(unittest.TestCase):
'<a href="|tag|tagname">link</a>')
page = Page(**args)
content = page.get_content('http://notmyidea.org')
self.assertEquals(content, ('A simple test, with a '
'<a href="tag/tagname.html">link</a>'))
self.assertEqual(content, ('A simple test, with a '
'<a href="tag/tagname.html">link</a>'))
# Category
args['content'] = ('A simple test, with a '
'<a href="|category|category">link</a>')
page = Page(**args)
content = page.get_content('http://notmyidea.org')
self.assertEquals(content,
('A simple test, with a '
'<a href="category/category.html">link</a>'))
self.assertEqual(content,
('A simple test, with a '
'<a href="category/category.html">link</a>'))
def test_intrasite_link(self):
# type does not take unicode in PY2 and bytes in PY3, which in
@ -222,7 +222,7 @@ class TestPage(unittest.TestCase):
'<a href="|filename|article.rst">link</a>'
)
content = Page(**args).get_content('http://notmyidea.org')
self.assertEquals(
self.assertEqual(
content,
'A simple test, with a '
'<a href="http://notmyidea.org/article.html">link</a>'
@ -234,7 +234,7 @@ class TestPage(unittest.TestCase):
'<a href="|filename|article.rst#section-2">link</a>'
)
content = Page(**args).get_content('http://notmyidea.org')
self.assertEquals(
self.assertEqual(
content,
'A simple test, with a '
'<a href="http://notmyidea.org/article.html#section-2">link</a>'
@ -247,7 +247,7 @@ class TestPage(unittest.TestCase):
'?utm_whatever=234&highlight=word">link</a>'
)
content = Page(**args).get_content('http://notmyidea.org')
self.assertEquals(
self.assertEqual(
content,
'A simple test, with a '
'<a href="http://notmyidea.org/article.html'
@ -261,7 +261,7 @@ class TestPage(unittest.TestCase):
'?utm_whatever=234&highlight=word#section-2">link</a>'
)
content = Page(**args).get_content('http://notmyidea.org')
self.assertEquals(
self.assertEqual(
content,
'A simple test, with a '
'<a href="http://notmyidea.org/article.html'

View file

@ -3,7 +3,10 @@ from __future__ import unicode_literals
import os
from codecs import open
from mock import MagicMock
try:
from unittest.mock import MagicMock
except ImportError:
from mock import MagicMock
from shutil import rmtree
from tempfile import mkdtemp