소스 검색

Add test_integration(); add a horrible abuse of PEP8

tags/v0.2
Ben Kurtovic 11 년 전
부모
커밋
094e867ee6
2개의 변경된 파일21개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      tests/_test_tree_equality.py
  2. +20
    -0
      tests/test_builder.py

+ 1
- 1
tests/_test_tree_equality.py 파일 보기

@@ -74,7 +74,7 @@ class TreeEqualityTestCase(TestCase):
self.assertEqual(expected.value, actual.value) self.assertEqual(expected.value, actual.value)
self.assertIs(expected.named, actual.named) self.assertIs(expected.named, actual.named)
self.assertIs(expected.hexadecimal, actual.hexadecimal) self.assertIs(expected.hexadecimal, actual.hexadecimal)
self.assertEquals(expected.hex_char, actual.hex_char)
self.assertEqual(expected.hex_char, actual.hex_char)


def assertTagNodeEqual(self, expected, actual): def assertTagNodeEqual(self, expected, actual):
"""Assert that two Tag nodes have the same data.""" """Assert that two Tag nodes have the same data."""


+ 20
- 0
tests/test_builder.py 파일 보기

@@ -204,5 +204,25 @@ class TestBuilder(TreeEqualityTestCase):
"""tests for building Tag nodes""" """tests for building Tag nodes"""
pass pass


def test_integration(self):
"""a test for building a combination of templates together"""
test = [tokens.TemplateOpen(), tokens.TemplateOpen(),
tokens.TemplateOpen(), tokens.TemplateOpen(),
tokens.Text(text="foo"), tokens.TemplateClose(),
tokens.Text(text="bar"), tokens.TemplateParamSeparator(),
tokens.Text(text="baz"), tokens.TemplateParamEquals(),
tokens.Text(text="biz"), tokens.TemplateClose(),
tokens.Text(text="buzz"), tokens.TemplateClose(),
tokens.Text(text="usr"), tokens.TemplateParamSeparator(),
tokens.TemplateOpen(), tokens.Text(text="bin"),
tokens.TemplateClose(), tokens.TemplateClose()]
valid = wrap(
[Template(wrap([Template(wrap([Template(wrap([Template(wrap([Text(
"foo")])), Text("bar")]), params=[Parameter(wrap([Text("baz")]),
wrap([Text("biz")]))]), Text("buzz")])), Text("usr")]), params=[
Parameter(wrap([Text("1")]), wrap([Template(wrap([Text("bin")]))]),
showkey=False)])])
self.assertWikicodeEqual(valid, self.builder.build(test))

if __name__ == "__main__": if __name__ == "__main__":
unittest.main(verbosity=2) unittest.main(verbosity=2)

불러오는 중...
취소
저장