Exemplo n.º 1
0
def test_coerce_cycle_point_time_zone():
    """Test coerce_cycle_point_time_zone."""
    validator = VDR()
    # The good
    for value, result in [('', None), ('Z', 'Z'), ('+0000', '+0000'),
                          ('+0100', '+0100'), ('+1300', '+1300'),
                          ('-0630', '-0630')]:
        assert (validator.coerce_cycle_point_time_zone(value,
                                                       ['whatever']) == result)
    # The bad
    for value in ['None', 'Big Bang Time', 'Standard Galaxy Time']:
        with pytest.raises(IllegalValueError):
            validator.coerce_cycle_point_time_zone(value, ['whatever'])
Exemplo n.º 2
0
 def test_coerce_cycle_point_time_zone(self):
     """Test coerce_cycle_point_time_zone."""
     validator = VDR()
     # The good
     for value, result in [('', None), ('Z', 'Z'), ('+0000', '+0000'),
                           ('+0100', '+0100'), ('+1300', '+1300'),
                           ('-0630', '-0630')]:
         self.assertEqual(
             validator.coerce_cycle_point_time_zone(value, ['whatever']),
             result)
     # The bad
     for value in ['None', 'Big Bang Time', 'Standard Galaxy Time']:
         self.assertRaises(IllegalValueError,
                           validator.coerce_cycle_point_time_zone, value,
                           ['whatever'])
Exemplo n.º 3
0
 def test_coerce_cycle_point_time_zone(self):
     """Test coerce_cycle_point_time_zone."""
     validator = VDR()
     # The good
     for value, result in [
             ('', None),
             ('Z', 'Z'),
             ('+0000', '+0000'),
             ('+0100', '+0100'),
             ('+1300', '+1300'),
             ('-0630', '-0630')]:
         self.assertEqual(
             validator.coerce_cycle_point_time_zone(value, ['whatever']),
             result)
     # The bad
     for value in ['None', 'Big Bang Time', 'Standard Galaxy Time']:
         self.assertRaises(
             IllegalValueError,
             validator.coerce_cycle_point_time_zone, value, ['whatever'])