replace assert with assertEqual

pull/83/merge
Martin Zimmermann 10 years ago
parent 910da2a6c0
commit 0154113c80

@ -1,5 +1,10 @@
# -*- encoding: utf-8 -*-
try:
import unittest2 as unittest
except ImportError:
import unittest
import tempfile
from os.path import join, dirname
@ -9,16 +14,26 @@ from isso.db import SQLite3
from isso.migrate import Disqus
def test_disqus():
class TestMigration(unittest.TestCase):
def test_disqus(self):
xml = join(dirname(__file__), "disqus.xml")
xxx = tempfile.NamedTemporaryFile()
db = SQLite3(xxx.name, Config.load(None))
Disqus(db, xml).migrate()
self.assertEqual(db.threads["/"]["title"], "Hello, World!")
self.assertEqual(db.threads["/"]["id"], 1)
xml = join(dirname(__file__), "disqus.xml")
xxx = tempfile.NamedTemporaryFile()
a = db.comments.get(1)
db = SQLite3(xxx.name, Config.load(None))
Disqus(db, xml).migrate()
self.assertEqual(a["author"], "peter")
self.assertEqual(a["email"], "foo@bar.com")
assert db.threads["/"]["title"] == "Hello, World!"
assert db.threads["/"]["id"] == 1
b = db.comments.get(2)
self.assertEqual(b["parent"] ,a["id"])
a = db.comments.get(1)

Loading…
Cancel
Save