瀏覽代碼

test_argument()

tags/v0.2
Ben Kurtovic 11 年之前
父節點
當前提交
e32a6692f8
共有 1 個檔案被更改,包括 23 行新增1 行删除
  1. +23
    -1
      tests/test_builder.py

+ 23
- 1
tests/test_builder.py 查看文件

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


def test_argument(self): def test_argument(self):
"""tests for building Argument nodes""" """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): def test_wikilink(self):
"""tests for building Wikilink nodes""" """tests for building Wikilink nodes"""


Loading…
取消
儲存