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_as_naive_auto_generated_valid_formats(self):
for (timestamp, expected_datetime) in generate_valid_timestamp_and_datetime():
try:
self.assertEqual(ciso8601.parse_datetime_as_naive(timestamp), expected_datetime.replace(tzinfo=None))
except Exception:
print("Had problems parsing: {timestamp}".format(timestamp=timestamp))
raise
def parse_datetime(datetime_string):
try:
return ciso8601.parse_datetime_as_naive(datetime_string)
except ValueError:
return
except ImportError:
def get_datetime(item):
return timezone.make_aware(parse_datetime_as_naive(item['recordedTime']))
def __parse_date(date_string):
return ciso8601.parse_datetime_as_naive(date_string).date()
def __parse_datetime(date_string):
return ciso8601.parse_datetime_as_naive(date_string)