diff options
author | Martin Vilcans <martin@librador.com> | 2011-08-24 01:11:59 +0200 |
---|---|---|
committer | Martin Vilcans <martin@librador.com> | 2011-08-24 01:11:59 +0200 |
commit | 471fda12cf496f3bee4aa3aad7e04a2cc7073c8a (patch) | |
tree | ebd8c1648cfa7ac325b93551eed7898752cc24b1 /tests/parse_test.py | |
parent | cd6a0be01d0f09faa55760769a9beee011599240 (diff) | |
download | screenplain-471fda12cf496f3bee4aa3aad7e04a2cc7073c8a.tar.gz |
New spec for transitions.
The rule that a transition must be followed by a slug is not implemented.
Diffstat (limited to 'tests/parse_test.py')
-rw-r--r-- | tests/parse_test.py | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/tests/parse_test.py b/tests/parse_test.py index 75d762a..1eabdb2 100644 --- a/tests/parse_test.py +++ b/tests/parse_test.py @@ -95,8 +95,6 @@ class ParseTests(unittest2.TestCase): self.assertEquals([(False, 'Fuck retirement!')], dual.right.blocks) def test_standard_transition(self): - # Need clarification of the spec here, see - # http://prolost.com/blog/2011/8/9/screenplay-markdown.html?lastPage=true#comment14865294 paras = list(parse.parse([ 'Jack begins to argue vociferously in Vietnamese (?)', @@ -107,5 +105,48 @@ class ParseTests(unittest2.TestCase): ])) self.assertEquals([Action, Transition, Slug], [type(p) for p in paras]) + def test_standard_transition(self): + + paras = list(parse.parse([ + 'Jack begins to argue vociferously in Vietnamese (?)', + '', + 'CUT TO:', + '', + "EXT. BRICK'S POOL - DAY", + ])) + self.assertEquals([Action, Transition, Slug], [type(p) for p in paras]) + + def test_transition_needs_to_be_upper_case(self): + paras = list(parse.parse([ + 'Jack begins to argue vociferously in Vietnamese (?)', + '', + 'cut to:', + '', + "EXT. BRICK'S POOL - DAY", + ])) + self.assertEquals([Action, Action, Slug], [type(p) for p in paras]) + + def test_not_a_transition_on_trailing_whitespace(self): + paras = list(parse.parse([ + 'Jack begins to argue vociferously in Vietnamese (?)', + '', + 'CUT TO: ', + '', + "EXT. BRICK'S POOL - DAY", + ])) + self.assertEquals([Action, Action, Slug], [type(p) for p in paras]) + + # Not implemented yet + @unittest2.expectedFailure + def test_transition_must_be_followed_by_slug(self): + paras = list(parse.parse([ + 'Bill lights a cigarette.', + '', + 'CUT TO:', + '', + 'SOME GUY mowing the lawn.', + ])) + self.assertEquals([Action, Action, Action], [type(p) for p in paras]) + if __name__ == '__main__': unittest2.main() |