Browse Source

test_argument()

tags/v0.2
Ben Kurtovic 11 years ago
parent
commit
e32a6692f8
1 changed files with 23 additions and 1 deletions
  1. +23
    -1
      tests/test_builder.py

+ 23
- 1
tests/test_builder.py View File

@@ -101,7 +101,29 @@ class TestBuilder(TreeEqualityTestCase):

def test_argument(self):
"""tests for building Argument nodes"""
pass
tests = [
([tokens.ArgumentOpen(), tokens.Text(text="foobar"),
tokens.ArgumentClose()],
wrap([Argument(wrap([Text("foobar")]))])),

([tokens.ArgumentOpen(), tokens.Text(text="spam"),
tokens.Text(text="eggs"), tokens.ArgumentClose()],
wrap([Argument(wrap([Text("spam"), Text("eggs")]))])),

([tokens.ArgumentOpen(), tokens.Text(text="foo"),
tokens.ArgumentSeparator(), tokens.Text(text="bar"),
tokens.ArgumentClose()],
wrap([Argument(wrap([Text("foo")]), wrap([Text("bar")]))])),

([tokens.ArgumentOpen(), tokens.Text(text="foo"),
tokens.Text(text="bar"), tokens.ArgumentSeparator(),
tokens.Text(text="baz"), tokens.Text(text="biz"),
tokens.ArgumentClose()],
wrap([Argument(wrap([Text("foo"), Text("bar")]),
wrap([Text("baz"), Text("biz")]))])),
]
for test, valid in tests:
self.assertWikicodeEqual(valid, self.builder.build(test))

def test_wikilink(self):
"""tests for building Wikilink nodes"""


Loading…
Cancel
Save