Commits

matt chisholm committed 435ff92

use unittest.TestCase and assertEquals

Comments (0)

Files changed (1)

 from pottymouth import PottyMouth, Node, Token
 
 
-class TestPottyMouth(object):
+class TestPottyMouth(unittest.TestCase):
 
-    def setup(self):
+    def setUp(self):
         self.parser = PottyMouth(
             url_check_domains=('mysite.com',),
             url_white_lists=(
 
 
     def test_repr(self):
-        assert repr(self.parser.parse("foo • bar")) == "[[[TEXT{u'foo'}], [BULLET{u' \\u2022 '}], [TEXT{u'bar'}]]]"
-        assert repr(self.parser.parse("foo • bar".encode('utf8'))) == "[[[TEXT{u'foo'}], [BULLET{u' \\u2022 '}], [TEXT{u'bar'}]]]"
+        self.assertEquals(repr(self.parser.parse("foo • bar")), "[[[TEXT{u'foo'}], [BULLET{u' \\u2022 '}], [TEXT{u'bar'}]]]")
+        self.assertEquals(repr(self.parser.parse("foo • bar".encode('utf8'))), "[[[TEXT{u'foo'}], [BULLET{u' \\u2022 '}], [TEXT{u'bar'}]]]")
 
 
     def _helper(self, source, expected):
             result = list(d.compare(expected.split(b'\n'), generated.split(b'\n')))
             print b'\n'.join(result)
             print source.encode('utf8')
-            assert generated == expected
+            self.assertEquals(generated, expected)
 
 
     def test_some_paragraphs(self):
         self._helper('\n\t\n\n', [])
 
     def test_tokenizer(self):
-        assert(self.parser.tokenize("A *BOLD* thing") == [Token('TEXT', 'A '), Token('STAR', '*'), Token('TEXT', 'BOLD'), Token('ITEMSTAR', '* '), Token('TEXT', 'thing'),])
+        self.assertEquals(self.parser.tokenize("A *BOLD* thing"), [Token('TEXT', 'A '), Token('STAR', '*'), Token('TEXT', 'BOLD'), Token('ITEMSTAR', '* '), Token('TEXT', 'thing'),])