# Path: smarkets/datetime.py
# def parse_datetime(iso):
#     """Convert ISO8601 formatted timestamp to timezone-naive, UTC-normalized datetime object."""
#     iso = iso.replace(',', '.')
#     return iso8601.parse_date(iso).astimezone(pytz.utc).replace(tzinfo=None)


import datetime
import unittest
import iso8601
from nose.tools import assert_raises, eq_
from smarkets.datetime import parse_datetime
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals





class DateTests(unittest.TestCase):

    def test_valid_iso_conversion(self):
        valid_iso_dates = (
            ('2009-04-24T15:48:26,000000Z', datetime.datetime(2009, 0o4, 24, 15, 48, 26, 0)),
            ('2009-04-24T15:48:26', datetime.datetime(2009, 0o4, 24, 15, 48, 26, 0)),
            ('2009-04-24T15:48:26.000000Z', datetime.datetime(2009, 0o4, 24, 15, 48, 26, 0)),
        )
        for iso, real_date in valid_iso_dates:

# Path: smarkets/datetime.py
# def parse_datetime(iso):
#     """Convert ISO8601 formatted timestamp to timezone-naive, UTC-normalized datetime object."""
#     iso = iso.replace(',', '.')
#     return iso8601.parse_date(iso).astimezone(pytz.utc).replace(tzinfo=None)


# Path: smarkets/tests/datetime.py
import datetime
import unittest
import iso8601
from nose.tools import assert_raises, eq_
from smarkets.datetime import parse_datetime

# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals





class DateTests(unittest.TestCase):

    def test_valid_iso_conversion(self):
        valid_iso_dates = (
            ('2009-04-24T15:48:26,000000Z', datetime.datetime(2009, 0o4, 24, 15, 48, 26, 0)),
            ('2009-04-24T15:48:26', datetime.datetime(2009, 0o4, 24, 15, 48, 26, 0)),
            ('2009-04-24T15:48:26.000000Z', datetime.datetime(2009, 0o4, 24, 15, 48, 26, 0)),
        )
        for iso, real_date in valid_iso_dates:

            result = parse_datetime(iso)