def testLimitSortedStopsTooClose(self):
    """Sort by increasing distance, keeping the N closest."""
    self.problems = self.CreateLimitPerTypeProblemReporter(3)
    self.accumulator = self.problems.GetAccumulator()
    for i, distance in enumerate((4.0, 3.0, 2.5, 2.2, 1.0, 0.0)):
      self.problems.StopsTooClose(
          "Sa %d" % i, "sa%d" % i, "Sb %d" % i, "sb%d" % i, distance)
    self.assertEquals(6, self.accumulator.WarningCount())
    self.assertEquals(0, self.accumulator.ErrorCount())
    self.assertProblemsAttribute(transitfeed.TYPE_WARNING,
        "StopsTooClose", "stop_id_a", "sa5 sa4 sa3")
dataset/ETHPy150Open google/transitfeed/tests/testfeedvalidator.py/LimitPerTypeProblemReporterTestCase.testLimitSortedStopsTooClose/original