Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_parse_incorrect_unitstring(self):
for datestr in ("days since2017-05-01 ", "dayssince 2017-05-01 00:00", "days snce 2017-05-01 00:00", "days_since_2017-05-01 00:00",
"days_since_2017-05-01_00:00"):
self.assertRaises(
ValueError, cftime._cftime._dateparse, datestr, 'standard')
self.assertRaises(
ValueError, cftime._cftime.num2date, 1, datestr, 'standard')
self.assertRaises(
ValueError, cftime._cftime.date2num, datetime(1900, 1, 1, 0), datestr, 'standard')
def test_parse_incorrect_unitstring(self):
for datestr in ("days since2017-05-01 ", "dayssince 2017-05-01 00:00", "days snce 2017-05-01 00:00", "days_since_2017-05-01 00:00",
"days_since_2017-05-01_00:00"):
self.assertRaises(
ValueError, cftime._cftime._dateparse, datestr)
self.assertRaises(
ValueError, cftime._cftime.num2date, 1, datestr)
self.assertRaises(
ValueError, cftime._cftime.date2num, datetime(1900, 1, 1, 0), datestr)