aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/files/boneyard.fountain22
-rw-r--r--tests/files/boneyard.fountain.html4
-rw-r--r--tests/files_test.py6
-rw-r--r--tests/fountain_test.py7
4 files changed, 38 insertions, 1 deletions
diff --git a/tests/files/boneyard.fountain b/tests/files/boneyard.fountain
new file mode 100644
index 0000000..3d3adc2
--- /dev/null
+++ b/tests/files/boneyard.fountain
@@ -0,0 +1,22 @@
+As he rattles off the long list, Brick and Steel share a look. This is going to be BAD.
+
+CUT TO:
+/*
+INT. GARAGE - DAY
+
+BRICK and STEEL get into Mom's PORSCHE, Steel at the wheel. They pause for a beat, the gravity of the situation catching up with them.
+
+BRICK
+This is everybody we've ever put away.
+
+STEEL
+(starting the engine)
+So much for retirement!
+
+They speed off. To destiny!
+
+CUT TO:
+*/
+EXT. PALATIAL MANSION - DAY
+
+An EXTREMELY HANDSOME MAN drinks a beer. Shirtless, unfortunately.
diff --git a/tests/files/boneyard.fountain.html b/tests/files/boneyard.fountain.html
new file mode 100644
index 0000000..291581b
--- /dev/null
+++ b/tests/files/boneyard.fountain.html
@@ -0,0 +1,4 @@
+<div class="action"><p>As he rattles off the long list, Brick and Steel share a look.&nbsp; This is going to be BAD.</p></div>
+<div class="transition">CUT TO:</div>
+<h6>EXT. PALATIAL MANSION - DAY</h6>
+<div class="action"><p>An EXTREMELY HANDSOME MAN drinks a beer.&nbsp; Shirtless, unfortunately.</p></div>
diff --git a/tests/files_test.py b/tests/files_test.py
index 0f0cba0..46eb349 100644
--- a/tests/files_test.py
+++ b/tests/files_test.py
@@ -70,3 +70,9 @@ class ParseTests(unittest2.TestCase):
'sections.fountain', 'sections.html',
'sections.fountain.html', '--bare')
self.assertMultiLineEqual(expected, actual)
+
+ def test_boneyard(self):
+ actual, expected = self.convert(
+ 'boneyard.fountain', 'sections.html',
+ 'boneyard.fountain.html', '--bare')
+ self.assertMultiLineEqual(expected, actual)
diff --git a/tests/fountain_test.py b/tests/fountain_test.py
index 11a0939..5b1d386 100644
--- a/tests/fountain_test.py
+++ b/tests/fountain_test.py
@@ -3,12 +3,17 @@
# http://www.opensource.org/licenses/mit-license.php
import unittest2
-from screenplain.parsers.fountain import parse
from screenplain.parsers import fountain
from screenplain.types import (
Slug, Action, Dialog, DualDialog, Transition, Section
)
from screenplain.richstring import plain, italic, empty_string
+from StringIO import StringIO
+
+
+def parse(lines):
+ content = '\n'.join(lines)
+ return fountain.parse(StringIO(content))
class SlugTests(unittest2.TestCase):