Test the goals file's section reader and the round-title breach's wording in process
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import unittest
|
||||
|
||||
from failure import Failure
|
||||
from release_plan.goals_file import section
|
||||
|
||||
GOALS_FILE = "# P\n## Goals\n1. g\n## Audience\nme\n"
|
||||
|
||||
|
||||
class Section(unittest.TestCase):
|
||||
def test_gives_the_text_under_the_one_heading(self):
|
||||
self.assertEqual(section(GOALS_FILE, "Goals"), "1. g")
|
||||
self.assertEqual(section(GOALS_FILE, "Audience"), "me")
|
||||
|
||||
def test_says_what_the_goals_file_lacks(self):
|
||||
self.assertEqual(section(GOALS_FILE, "Method"), Failure("has no ## Method heading"))
|
||||
self.assertEqual(section(GOALS_FILE + "## Audience\nyou\n", "Audience"), Failure("has ## Audience more than once"))
|
||||
self.assertEqual(section("## Goals\n\n## Audience\nme\n", "Goals"), Failure("has no text under ## Goals"))
|
||||
Reference in New Issue
Block a user