diff options
author | Martin Vilcans <martin@librador.com> | 2011-09-21 23:36:40 +0200 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2011-09-21 23:36:40 +0200 |
commit | 8372179a6d8426896737d6c37a5568fdea5dce5f (patch) | |
tree | 4181d3edf92dced69f36aa716b5e2b224b3a03f6 /tests/spmd_test.py | |
parent | f38a458da58b0cbd456ff935f8a8f84f1a1f385d (diff) | |
download | screenplain-8372179a6d8426896737d6c37a5568fdea5dce5f.tar.gz |
Added requirement that a slug must be only one line.
Otherwise it is parsed as dialog.
Diffstat (limited to 'tests/spmd_test.py')
-rw-r--r-- | tests/spmd_test.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/spmd_test.py b/tests/spmd_test.py index 4a04660..5df8395 100644 --- a/tests/spmd_test.py +++ b/tests/spmd_test.py @@ -17,6 +17,19 @@ class ParseTests(unittest2.TestCase): ])) self.assertEquals([Slug, Action], [type(p) for p in paras]) + def test_slug_must_be_single_line(self): + paras = list(parse([ + 'INT. SOMEWHERE - DAY', + 'ANOTHER LINE', + '', + 'Some action', + ])) + self.assertEquals([Dialog, Action], [type(p) for p in paras]) + # What looks like a scene headingis parsed as a character name. + # Unexpected perhaps, but that's how I interpreted the spec. + self.assertEquals('INT. SOMEWHERE - DAY', paras[0].character) + self.assertEquals(['Some action'], paras[1].lines) + def test_action_is_not_a_slug(self): paras = list(parse([ '', |