aboutsummaryrefslogtreecommitdiffstats
path: root/tests/spmd_test.py
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2012-02-08 00:05:01 +0100
committerMartin Vilcans <martin@librador.com>2012-02-08 00:05:10 +0100
commit429e3a428d3bd7f681bea753525dcffba078c4bf (patch)
tree1155c601202b7a2576a5a1edcfa90bb94bbffec0 /tests/spmd_test.py
parentb2dbd04a50a159ba18caa152ae98267a16f89c28 (diff)
downloadscreenplain-429e3a428d3bd7f681bea753525dcffba078c4bf.tar.gz
Added support for sections
Diffstat (limited to 'tests/spmd_test.py')
-rw-r--r--tests/spmd_test.py16
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):