def test_lines_match_semi_line_is_full_subset_of_dataset_lines(self): semi_lines = list(range(24, 45)) dataset_lines = list(range(27, 41)) percent = percent_matched(dataset_lines, semi_lines) self.assertEqual(percent, 1.0) semi_lines = list(range(78, 99)) dataset_lines = list(range(72, 121)) percent = percent_matched(dataset_lines, semi_lines) self.assertEqual(percent, 0.42857142857142855)
def test_percent_partially_matched(self): semi_lines = list(range(65, 81)) dataset_lines = list(range(69, 82)) percent = percent_matched(dataset_lines, semi_lines) self.assertEqual(percent, 12 / 13)
def test_percent_not_matched(self): semi_lines = list(range(65, 68)) dataset_lines = list(range(69, 82)) percent = percent_matched(dataset_lines, semi_lines) self.assertEqual(percent, 0)
def test_get_percent_matched(self): semi_lines = list(range(50, 58)) dataset_lines = list(range(50, 58)) percent = percent_matched(dataset_lines, semi_lines) self.assertEqual(percent, 1.0)