def test_is_iterator(self): self.assertEqual( next(parse_ranges('1-4')), 1, )
def test_three_ranges(self): self.assertEqual( list(parse_ranges('1-2,4-4,8-10')), [1, 2, 4, 8, 9, 10], )
def test_four_ranges(self): self.assertEqual( list(parse_ranges('0-0,4-8,20-21,43-45')), [0, 4, 5, 6, 7, 8, 20, 21, 43, 44, 45], )
def test_single_range(self): self.assertEqual( list(parse_ranges('1-4')), [1, 2, 3, 4], )