示例#1
0
 def test_multiple_yyyymm_range(self):
     '''Test if using an overlapping range produces the right result'''
     test_range = [['201203', '201301'], ['201207', '201209']]
     valid_result = {2012:set(range(3, 13)),
                     2013:range(1, 2)}
     self.assertEqual(valid_result,
                      validate_multiple_yyyymm_range(test_range, 'month'))
示例#2
0
 def test_multiple_yyyymm_range_distinct(self):
     '''Test if using distinct ranges in the same year produces the right result'''
     test_range = [['201203', '201207'], ['201209', '201303']]
     valid_result = {
         2012: set.union(set(range(3, 8)), set(range(9, 13))),
         2013: range(1, 4)
     }
     self.assertEqual(valid_result,
                      validate_multiple_yyyymm_range(test_range, 'month'))
示例#3
0
 def test_multiple_yyyymm_range_single(self):
     '''Test if a single range produces the right result'''
     test_range = [['201203', '201301']]
     valid_result = {2012: range(3, 13), 2013: range(1, 2)}
     self.assertEqual(valid_result,
                      validate_multiple_yyyymm_range(test_range, 'month'))