# Path: compliance_checker/util.py
# def datetime_is_iso(date_str):
# def dateparse(date_str):
# def kvp_convert(input_coll):


import unittest
from compliance_checker import util
"""



class TestUtils(unittest.TestCase):
    """
    Test suite for utilities
    """

    def test_datetime_is_iso(self):
        """
        Test that ISO 8601 dates are properly parsed, and non ISO 8601 dates
        are excluded
        """
        good_datetime = "2011-01-21T02:30:11Z"
        self.assertTrue(util.datetime_is_iso(good_datetime)[0])

        good_date = "2017-02-01"
        self.assertTrue(util.datetime_is_iso(good_date)[0])

        good_date = "20170201"
        self.assertTrue(util.datetime_is_iso(good_date)[0])

        good_datetime = "2017-09-19T23:06:17+00:00"
        self.assertTrue(util.datetime_is_iso(good_datetime)[0])

        good_datetime = "20170919T230617Z"
        self.assertTrue(util.datetime_is_iso(good_datetime)[0])

        good_date = "2017-W38"

# Path: compliance_checker/util.py
# def datetime_is_iso(date_str):
# def dateparse(date_str):
# def kvp_convert(input_coll):


# Path: compliance_checker/tests/test_util.py
import unittest
from compliance_checker import util

"""



class TestUtils(unittest.TestCase):
    """
    Test suite for utilities
    """

    def test_datetime_is_iso(self):
        """
        Test that ISO 8601 dates are properly parsed, and non ISO 8601 dates
        are excluded
        """
        good_datetime = "2011-01-21T02:30:11Z"
        self.assertTrue(util.datetime_is_iso(good_datetime)[0])

        good_date = "2017-02-01"
        self.assertTrue(util.datetime_is_iso(good_date)[0])

        good_date = "20170201"
        self.assertTrue(util.datetime_is_iso(good_date)[0])

        good_datetime = "2017-09-19T23:06:17+00:00"
        self.assertTrue(util.datetime_is_iso(good_datetime)[0])

        good_datetime = "20170919T230617Z"
        self.assertTrue(util.datetime_is_iso(good_datetime)[0])

        good_date = "2017-W38"

        self.assertTrue(util.datetime_is_iso(good_date)[0])