]> code.communitydata.science - rises_declines_wikia_code.git/blob - mediawiki_dump_tools/Mediawiki-Utilities/mw/xml_dump/iteration/tests/test_comment.py
Initial commit
[rises_declines_wikia_code.git] / mediawiki_dump_tools / Mediawiki-Utilities / mw / xml_dump / iteration / tests / test_comment.py
1 from nose.tools import eq_
2
3 from ..comment import Comment
4
5
6 def test_immutability():
7     c = Comment("foo")
8     b = Comment(c)
9     eq_(id(c), id(b))
10
11
12 def test_empty_constructor():
13     c = Comment()
14     eq_(c, "")
15     eq_(c.deleted, False)
16
17
18 def test_deleted_constructor():
19     c = Comment("", deleted=True)
20     eq_(c, "")
21     eq_(c.deleted, True)
22
23
24 def test_full_constructor():
25     c = Comment("Foobar!", deleted=False)
26     eq_(c, "Foobar!")
27     eq_(c.deleted, False)
28
29
30 def test_serialize():
31     c = Comment("Foobar!", deleted=False)
32     c2 = Comment.deserialize(c.serialize())
33     eq_(c2.deleted, False)

Community Data Science Collective || Want to submit a patch?