Bläddra i källkod

Move wrap() and wraptext() TO _test_tree_equality.

tags/v0.2
Ben Kurtovic 11 år sedan
förälder
incheckning
7853e20745
8 ändrade filer med 11 tillägg och 35 borttagningar
  1. +4
    -0
      tests/_test_tree_equality.py
  2. +1
    -5
      tests/test_argument.py
  3. +1
    -5
      tests/test_builder.py
  4. +1
    -5
      tests/test_heading.py
  5. +1
    -5
      tests/test_html_entity.py
  6. +1
    -5
      tests/test_parameter.py
  7. +1
    -5
      tests/test_template.py
  8. +1
    -5
      tests/test_wikilink.py

+ 4
- 0
tests/_test_tree_equality.py Visa fil

@@ -26,8 +26,12 @@ from unittest import TestCase
from mwparserfromhell.nodes import (Argument, Comment, Heading, HTMLEntity,
Tag, Template, Text, Wikilink)
from mwparserfromhell.nodes.extras import Attribute, Parameter
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

wrap = lambda L: Wikicode(SmartList(L))
wraptext = lambda t: wrap([Text(t)])

class TreeEqualityTestCase(TestCase):
"""A base test case with support for comparing the equality of node trees.



+ 1
- 5
tests/test_argument.py Visa fil

@@ -25,12 +25,8 @@ import unittest

from mwparserfromhell.compat import str
from mwparserfromhell.nodes import Argument, Text
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

from ._test_tree_equality import TreeEqualityTestCase

wrap = lambda L: Wikicode(SmartList(L))
from ._test_tree_equality import TreeEqualityTestCase, wrap

class TestArgument(TreeEqualityTestCase):
"""Test cases for the Argument node."""


+ 1
- 5
tests/test_builder.py Visa fil

@@ -28,12 +28,8 @@ from mwparserfromhell.nodes import (Argument, Comment, Heading, HTMLEntity,
from mwparserfromhell.nodes.extras import Attribute, Parameter
from mwparserfromhell.parser import tokens
from mwparserfromhell.parser.builder import Builder
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

from ._test_tree_equality import TreeEqualityTestCase

wrap = lambda L: Wikicode(SmartList(L))
from ._test_tree_equality import TreeEqualityTestCase, wrap

class TestBuilder(TreeEqualityTestCase):
"""Tests for the builder, which turns tokens into Wikicode objects."""


+ 1
- 5
tests/test_heading.py Visa fil

@@ -25,12 +25,8 @@ import unittest

from mwparserfromhell.compat import str
from mwparserfromhell.nodes import Heading, Text
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

from ._test_tree_equality import TreeEqualityTestCase

wrap = lambda L: Wikicode(SmartList(L))
from ._test_tree_equality import TreeEqualityTestCase, wrap

class TestHeading(TreeEqualityTestCase):
"""Test cases for the Heading node."""


+ 1
- 5
tests/test_html_entity.py Visa fil

@@ -25,12 +25,8 @@ import unittest

from mwparserfromhell.compat import str
from mwparserfromhell.nodes import HTMLEntity
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

from ._test_tree_equality import TreeEqualityTestCase

wrap = lambda L: Wikicode(SmartList(L))
from ._test_tree_equality import TreeEqualityTestCase, wrap

class TestHTMLEntity(TreeEqualityTestCase):
"""Test cases for the HTMLEntity node."""


+ 1
- 5
tests/test_parameter.py Visa fil

@@ -26,12 +26,8 @@ import unittest
from mwparserfromhell.compat import str
from mwparserfromhell.nodes import Text
from mwparserfromhell.nodes.extras import Parameter
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

from ._test_tree_equality import TreeEqualityTestCase

wrap = lambda L: Wikicode(SmartList(L))
from ._test_tree_equality import TreeEqualityTestCase, wrap

class TestParameter(TreeEqualityTestCase):
"""Test cases for the Parameter node extra."""


+ 1
- 5
tests/test_template.py Visa fil

@@ -26,12 +26,8 @@ import unittest
from mwparserfromhell.compat import str
from mwparserfromhell.nodes import HTMLEntity, Template, Text
from mwparserfromhell.nodes.extras import Parameter
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode
from ._test_tree_equality import TreeEqualityTestCase
from ._test_tree_equality import TreeEqualityTestCase, wrap, wraptext

wrap = lambda L: Wikicode(SmartList(L))
wraptext = lambda t: wrap([Text(t)])
pgens = lambda k, v: Parameter(wraptext(k), wraptext(v), showkey=True)
pgenh = lambda k, v: Parameter(wraptext(k), wraptext(v), showkey=False)



+ 1
- 5
tests/test_wikilink.py Visa fil

@@ -25,12 +25,8 @@ import unittest

from mwparserfromhell.compat import str
from mwparserfromhell.nodes import Text, Wikilink
from mwparserfromhell.smart_list import SmartList
from mwparserfromhell.wikicode import Wikicode

from ._test_tree_equality import TreeEqualityTestCase

wrap = lambda L: Wikicode(SmartList(L))
from ._test_tree_equality import TreeEqualityTestCase, wrap

class TestWikilink(TreeEqualityTestCase):
"""Test cases for the Wikilink node."""


Laddar…
Avbryt
Spara