@@ -41,16 +41,11 @@ class TestArgument(TreeEqualityTestCase): | |||||
def test_strip(self): | def test_strip(self): | ||||
"""test Argument.__strip__()""" | """test Argument.__strip__()""" | ||||
node = Argument(wrap([Text("foobar")])) | node = Argument(wrap([Text("foobar")])) | ||||
self.assertIs(None, node.__strip__(True, True)) | |||||
self.assertIs(None, node.__strip__(True, False)) | |||||
self.assertIs(None, node.__strip__(False, True)) | |||||
self.assertIs(None, node.__strip__(False, False)) | |||||
node2 = Argument(wrap([Text("foo")]), wrap([Text("bar")])) | node2 = Argument(wrap([Text("foo")]), wrap([Text("bar")])) | ||||
self.assertEqual("bar", node2.__strip__(True, True)) | |||||
self.assertEqual("bar", node2.__strip__(True, False)) | |||||
self.assertEqual("bar", node2.__strip__(False, True)) | |||||
self.assertEqual("bar", node2.__strip__(False, False)) | |||||
for a in (True, False): | |||||
for b in (True, False): | |||||
self.assertIs(None, node.__strip__(a, b)) | |||||
self.assertEqual("bar", node2.__strip__(a, b)) | |||||
def test_showtree(self): | def test_showtree(self): | ||||
"""test Argument.__showtree__()""" | """test Argument.__showtree__()""" | ||||
@@ -39,10 +39,9 @@ class TestComment(TreeEqualityTestCase): | |||||
def test_strip(self): | def test_strip(self): | ||||
"""test Comment.__strip__()""" | """test Comment.__strip__()""" | ||||
node = Comment("foobar") | node = Comment("foobar") | ||||
self.assertIs(None, node.__strip__(True, True)) | |||||
self.assertIs(None, node.__strip__(True, False)) | |||||
self.assertIs(None, node.__strip__(False, True)) | |||||
self.assertIs(None, node.__strip__(False, False)) | |||||
for a in (True, False): | |||||
for b in (True, False): | |||||
self.assertIs(None, node.__strip__(a, b)) | |||||
def test_showtree(self): | def test_showtree(self): | ||||
"""test Comment.__showtree__()""" | """test Comment.__showtree__()""" | ||||
@@ -41,10 +41,9 @@ class TestHeading(TreeEqualityTestCase): | |||||
def test_strip(self): | def test_strip(self): | ||||
"""test Heading.__strip__()""" | """test Heading.__strip__()""" | ||||
node = Heading(wrap([Text("foobar")]), 3) | node = Heading(wrap([Text("foobar")]), 3) | ||||
self.assertEqual("foobar", node.__strip__(True, True)) | |||||
self.assertEqual("foobar", node.__strip__(True, False)) | |||||
self.assertEqual("foobar", node.__strip__(False, True)) | |||||
self.assertEqual("foobar", node.__strip__(False, False)) | |||||
for a in (True, False): | |||||
for b in (True, False): | |||||
self.assertEqual("foobar", node.__strip__(a, b)) | |||||
def test_showtree(self): | def test_showtree(self): | ||||
"""test Heading.__showtree__()""" | """test Heading.__showtree__()""" | ||||
@@ -47,19 +47,13 @@ class TestHTMLEntity(TreeEqualityTestCase): | |||||
node1 = HTMLEntity("nbsp", named=True, hexadecimal=False) | node1 = HTMLEntity("nbsp", named=True, hexadecimal=False) | ||||
node2 = HTMLEntity("107", named=False, hexadecimal=False) | node2 = HTMLEntity("107", named=False, hexadecimal=False) | ||||
node3 = HTMLEntity("e9", named=False, hexadecimal=True) | node3 = HTMLEntity("e9", named=False, hexadecimal=True) | ||||
self.assertEqual("\xa0", node1.__strip__(True, True)) | |||||
self.assertEqual("\xa0", node1.__strip__(True, False)) | |||||
self.assertEqual(" ", node1.__strip__(False, True)) | |||||
self.assertEqual(" ", node1.__strip__(False, False)) | |||||
self.assertEqual("k", node2.__strip__(True, True)) | |||||
self.assertEqual("k", node2.__strip__(True, False)) | |||||
self.assertEqual("k", node2.__strip__(False, True)) | |||||
self.assertEqual("k", node2.__strip__(False, False)) | |||||
self.assertEqual("é", node3.__strip__(True, True)) | |||||
self.assertEqual("é", node3.__strip__(True, False)) | |||||
self.assertEqual("é", node3.__strip__(False, True)) | |||||
self.assertEqual("é", node3.__strip__(False, False)) | |||||
for a in (True, False): | |||||
self.assertEqual("\xa0", node1.__strip__(True, a)) | |||||
self.assertEqual(" ", node1.__strip__(False, a)) | |||||
self.assertEqual("k", node2.__strip__(True, a)) | |||||
self.assertEqual("k", node2.__strip__(False, a)) | |||||
self.assertEqual("é", node3.__strip__(True, a)) | |||||
self.assertEqual("é", node3.__strip__(False, a)) | |||||
def test_showtree(self): | def test_showtree(self): | ||||
"""test HTMLEntity.__showtree__()""" | """test HTMLEntity.__showtree__()""" | ||||
@@ -39,10 +39,9 @@ class TestText(unittest.TestCase): | |||||
def test_strip(self): | def test_strip(self): | ||||
"""test Text.__strip__()""" | """test Text.__strip__()""" | ||||
node = Text("foobar") | node = Text("foobar") | ||||
self.assertIs(node, node.__strip__(True, True)) | |||||
self.assertIs(node, node.__strip__(True, False)) | |||||
self.assertIs(node, node.__strip__(False, True)) | |||||
self.assertIs(node, node.__strip__(False, False)) | |||||
for a in (True, False): | |||||
for b in (True, False): | |||||
self.assertIs(node, node.__strip__(a, b)) | |||||
def test_showtree(self): | def test_showtree(self): | ||||
"""test Text.__showtree__()""" | """test Text.__showtree__()""" | ||||
@@ -41,16 +41,11 @@ class TestWikilink(TreeEqualityTestCase): | |||||
def test_strip(self): | def test_strip(self): | ||||
"""test Wikilink.__strip__()""" | """test Wikilink.__strip__()""" | ||||
node = Wikilink(wrap([Text("foobar")])) | node = Wikilink(wrap([Text("foobar")])) | ||||
self.assertEqual("foobar", node.__strip__(True, True)) | |||||
self.assertEqual("foobar", node.__strip__(True, False)) | |||||
self.assertEqual("foobar", node.__strip__(False, True)) | |||||
self.assertEqual("foobar", node.__strip__(False, False)) | |||||
node2 = Wikilink(wrap([Text("foo")]), wrap([Text("bar")])) | node2 = Wikilink(wrap([Text("foo")]), wrap([Text("bar")])) | ||||
self.assertEqual("bar", node2.__strip__(True, True)) | |||||
self.assertEqual("bar", node2.__strip__(True, False)) | |||||
self.assertEqual("bar", node2.__strip__(False, True)) | |||||
self.assertEqual("bar", node2.__strip__(False, False)) | |||||
for a in (True, False): | |||||
for b in (True, False): | |||||
self.assertEqual("foobar", node.__strip__(a, b)) | |||||
self.assertEqual("bar", node2.__strip__(a, b)) | |||||
def test_showtree(self): | def test_showtree(self): | ||||
"""test Wikilink.__showtree__()""" | """test Wikilink.__showtree__()""" | ||||