Skip to content

Commit

Permalink
Test for overlong manual scansions in known.py.
Browse files Browse the repository at this point in the history
Related to #75.
  • Loading branch information
David Fifield committed Sep 19, 2022
1 parent cf795ef commit b0136a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test_known.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import unittest

import known

class TestKnown(unittest.TestCase):
def test_total_length(self):
for line, scansion in known.KNOWN_SCANSIONS.items():
length = sum(sum({"-": 0.5, "+": 1}[c] for c in shape) for word, shape in scansion)
self.assertLessEqual(length, 12, (line, scansion))

0 comments on commit b0136a4

Please sign in to comment.