Ejemplo n.º 1
0
 def test_parse_interval_months_arg_raises_error_when_arg_is_not_positive(
         self):
     """Zero or negative values for time should raise a ValueError."""
     with self.assertRaises(ValueError):
         cli.parse_interval_months_arg('-5')
     with self.assertRaises(ValueError):
         cli.parse_interval_months_arg('0')
Ejemplo n.º 2
0
 def test_parse_interval_months_arg_succeeds_with_valid_arg(self):
     self.assertEqual(
         relativedelta.relativedelta(months=1),
         cli.parse_interval_months_arg('1'))
     self.assertEqual(
         relativedelta.relativedelta(months=36),
         cli.parse_interval_months_arg('36'))