Count, per finished chunk, the findings that arose from misreading code that had already shipped
This commit is contained in:
@@ -4,7 +4,7 @@ import unittest
|
||||
|
||||
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parent))
|
||||
|
||||
from round_titles import lacks_counts, past_cap, round_counts, round_findings
|
||||
from round_titles import lacks_counts, past_cap, round_counts, round_findings, round_misreads
|
||||
|
||||
|
||||
class Rounds(unittest.TestCase):
|
||||
@@ -39,12 +39,28 @@ class RoundFindings(unittest.TestCase):
|
||||
self.assertIsNone(round_findings(["Answer stability round 1: 1 🔴, 2 🟡 fix"]))
|
||||
self.assertIsNone(round_findings(["Do the work"]))
|
||||
|
||||
def test_reads_the_counts_of_a_title_that_also_counts_misread_findings(self):
|
||||
self.assertEqual(round_findings(["Answer stability round 1: 1 🔴, 2 🟡 (1 misread); fix", "Answer prose round 1: 0 🔴, 3 🟡 (0 misread)"]), (1, 5))
|
||||
|
||||
|
||||
def test_finds_a_round_title_without_counts(self):
|
||||
self.assertTrue(lacks_counts("Answer stability round 1: fix"))
|
||||
self.assertFalse(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡; fix"))
|
||||
self.assertTrue(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡; fix"))
|
||||
self.assertFalse(lacks_counts("Answer stability round 1: 0 🔴, 1 🟡 (0 misread); fix"))
|
||||
self.assertFalse(lacks_counts("Answer prose round 2: 0 🔴, 0 🟡 (0 misread)"))
|
||||
self.assertFalse(lacks_counts("Answer the question"))
|
||||
|
||||
|
||||
class RoundMisreads(unittest.TestCase):
|
||||
def test_sums_the_misread_findings_each_round_title_counts(self):
|
||||
self.assertEqual(round_misreads(["Answer stability round 1: 1 🔴, 2 🟡 (1 misread); fix", "Answer prose round 1: 0 🔴, 3 🟡 (2 misread)", "Merge origin/main"]), 3)
|
||||
self.assertEqual(round_misreads(["Answer stability round 1: 0 🔴, 0 🟡 (0 misread)"]), 0)
|
||||
|
||||
def test_knows_no_count_when_a_round_title_or_every_round_lacks_one(self):
|
||||
self.assertIsNone(round_misreads(["Answer stability round 1: 1 🔴, 2 🟡 (1 misread); fix", "Answer prose round 1: 0 🔴, 3 🟡; fix"]))
|
||||
self.assertIsNone(round_misreads(["Answer stability round 1: fix"]))
|
||||
self.assertIsNone(round_misreads(["Do the work"]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user