def test_temp_period2_19_00__19_31(self): in_time, out_time = self.get_time_range('2015-05-09 19:00:00', '2015-05-09 19:31:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 2)
def test_temp_period2_21_00__07_00(self): in_time, out_time = self.get_time_range('2015-05-09 21:00:00', '2015-05-10 07:00:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 5)
def test_temp_add(self): in_time, out_time = self.get_time_range('2015-05-09 18:29:00', '2015-05-09 19:01:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 2.5)
def test_temp_over_24_hour(self): in_time, out_time = self.get_time_range('2015-05-09 08:00:00', '2015-05-10 08:01:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 15.5)
def test_temp_free_08_00__08_30(self): in_time, out_time = self.get_time_range('2015-05-09 08:00:00', '2015-05-09 08:30:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 0.0)
def test_temp_one_tmp(self): in_time, out_time = self.get_time_range('2015-05-12 19:10:00', '2015-05-12 19:11:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 0.0)
def test_temp_one_hour_08_40__09_40(self): in_time, out_time = self.get_time_range('2015-05-09 08:40:00', '2015-05-09 09:40:00') result = rule.park_charge(rule.CarType.BLUE, in_time, out_time) self.assertEqual(result, 0.5)