aboutsummaryrefslogtreecommitdiffstats
path: root/tests/spmd_test.py
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2012-02-19 21:30:12 +0100
committerMartin Vilcans <martin@librador.com>2012-02-19 21:32:51 +0100
commit96dea19a41507b1dedc62f7ed478c0bf367a42c3 (patch)
treed4f5c8e43e8cdf0de6510b1441e9bed88aa8ddba /tests/spmd_test.py
parent03d27c86a728864d1ab59802f787aca893955fca (diff)
downloadscreenplain-96dea19a41507b1dedc62f7ed478c0bf367a42c3.tar.gz
Added synopsis support to slugs and sections.
Diffstat (limited to 'tests/spmd_test.py')
-rw-r--r--tests/spmd_test.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/spmd_test.py b/tests/spmd_test.py
index bb5f463..ab371cb 100644
--- a/tests/spmd_test.py
+++ b/tests/spmd_test.py
@@ -333,6 +333,44 @@ class ParseTests(unittest2.TestCase):
self.assertFalse(paras[0].centered)
self.assertEquals([plain(line) for line in lines], paras[0].lines)
+ def test_synopsis_after_slug_adds_synopsis_to_scene(self):
+ paras = list(parse([
+ "EXT. BRICK'S PATIO - DAY",
+ '',
+ "= Set up Brick & Steel's new life."
+ '',
+ ]))
+ self.assertEquals([Slug], [type(p) for p in paras])
+ self.assertEquals(
+ "Set up Brick & Steel's new life.",
+ paras[0].synopsis
+ )
+
+ def test_synopsis_in_section(self):
+ paras = list(parse([
+ '# section one',
+ '',
+ '= In which we get to know our characters'
+ ]))
+ self.assertEquals([Section], [type(p) for p in paras])
+ self.assertEquals(
+ 'In which we get to know our characters',
+ paras[0].synopsis
+ )
+
+ def test_synopsis_syntax_parsed_as_literal(self):
+ paras = list(parse([
+ 'Some action',
+ '',
+ '= A line that just happens to look like a synopsis'
+ ]))
+ self.assertEquals([Action, Action], [type(p) for p in paras])
+ self.assertEquals(
+ [plain('= A line that just happens to look like a synopsis')],
+ paras[1].lines
+ )
+
+
class TitlePageTests(unittest2.TestCase):
def test_basic_title_page(self):