Exemplo n.º 1
0
 def test_parse_dict_value_error(self):
     with self.assertRaises(ValueError):
         Availability.parse_dict({0: ['00:00', '01:00']})
     with self.assertRaises(ValueError):
         Availability.parse_dict({'0': ['00:00']})
     with self.assertRaises(ValueError):
         Availability.parse_dict({'0': ['00:00', '00:15', '00:30']})
     with self.assertRaises(ValueError):
         Availability.parse_dict({'0': ['00:00', '00:00']})
     with self.assertRaises(ValueError):
         Availability.parse_dict({'0': ['00:14', '01:00']})
Exemplo n.º 2
0
 def test_parse_dict_nonconsecutive_free_dict(self):
     self.assertEqual(Availability.parse_dict(c.nonconsecutive_free_dict),
                      {1, 3, 4, 5, 100})
Exemplo n.º 3
0
 def test_parse_dict_free_sat_sun_six_dict(self):
     self.assertEqual(Availability.parse_dict(c.free_sat_sun_six_dict),
                      {0, 1, 2, 669, 670, 671})
Exemplo n.º 4
0
 def test_parse_dict_never_free_dict(self):
     self.assertEqual(Availability.parse_dict(c.never_free_dict), set([]))
Exemplo n.º 5
0
 def test_parse_dict_free_first_five_dict(self):
     self.assertEqual(Availability.parse_dict(c.free_first_five_dict),
                      set(range(5)))
Exemplo n.º 6
0
 def test_parse_dict_always_free_dict(self):
     self.assertEqual(Availability.parse_dict(c.always_free_dict),
                      set(range(c.SLOTS_PER_WEEK)))