def test_IsNotIncompleteIfBothStartAndEndFound(self): sut = BeginEndMatcher() sut.process([start_55a5, end_55a5]) extras = sut.incompleteRequests() self.assertEquals(extras, [])
def test_IsIncompleteIfOnlyStartLineFound(self): sut = BeginEndMatcher() sut.process( [start_55a5] ) starts = sut.incompleteRequests() self.assertEqual(starts, [reformatted_55a5])
def test_ignoresOrphanedEnd(self): sut = BeginEndMatcher() sut.process( [end_3b9d] ) ends = sut.incompleteRequests() self.assertEqual(ends,[])
def test_shouldNotCountNonEndline(self): sut = BeginEndMatcher() sut.process( ["Nothing ends"] ) self.assertEqual(sut.on_end_detected, 0)
def test_shouldCountGoodEndline(self): sut = BeginEndMatcher() sut.process( [end_3b9d] ) self.assertEqual(sut.on_end_detected, 1)
def test_shouldNotCountLineWithoutMarker(self): sut = BeginEndMatcher() sut.process( ["line without marker"] ) self.assertEqual(sut.on_begin_detected, 0)
def test_shouldNotCountEmptyLine(self): sut = BeginEndMatcher() sut.process([""]) self.assertEqual(sut.on_begin_detected, 0)
def test_should_count_good_line(self): sut = BeginEndMatcher() sut.process( [start_55a5] ) self.assertEqual(sut.on_begin_detected, 1)
def test_shouldThrowExceptionIfNoId(self): sut = BeginEndMatcher() self.assertRaises( NoIdInString, lambda: sut.get_request_id_for_line("blah") )
def test_matchWorksForStartLine(self): sut = BeginEndMatcher() id = sut.get_request_id_for_line(start_55a5) self.assertEqual(id_55a5, id)