diff options
author | Martin Vilcans <martin@librador.com> | 2012-02-08 00:05:01 +0100 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2012-02-08 00:05:10 +0100 |
commit | 429e3a428d3bd7f681bea753525dcffba078c4bf (patch) | |
tree | 1155c601202b7a2576a5a1edcfa90bb94bbffec0 /tests/spmd_test.py | |
parent | b2dbd04a50a159ba18caa152ae98267a16f89c28 (diff) | |
download | screenplain-429e3a428d3bd7f681bea753525dcffba078c4bf.tar.gz |
Added support for sections
Diffstat (limited to 'tests/spmd_test.py')
-rw-r--r-- | tests/spmd_test.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/spmd_test.py b/tests/spmd_test.py index 21f39ae..aac8df9 100644 --- a/tests/spmd_test.py +++ b/tests/spmd_test.py @@ -4,7 +4,9 @@ import unittest2 from screenplain.parsers.spmd import parse -from screenplain.types import Slug, Action, Dialog, DualDialog, Transition +from screenplain.types import ( + Slug, Action, Dialog, DualDialog, Transition, Section +) from screenplain.richstring import plain, italic, empty_string @@ -80,6 +82,18 @@ class ParseTests(unittest2.TestCase): paras[0].line ) + def test_section_parsed_correctly(self): + paras = parse([ + '# first level', + '', + '## second level', + ]) + self.assertEquals([Section, Section], [type(p) for p in paras]) + self.assertEquals(1, paras[0].level) + self.assertEquals(plain('first level'), paras[0].text) + self.assertEquals(2, paras[1].level) + self.assertEquals(plain('second level'), paras[1].text) + # A Character element is any line entirely in caps, with one empty # line before it and without an empty line after it. def test_all_caps_is_character(self): |