# Path: configman/datetime_util.py
# def datetime_from_ISO_string(s):
#     """ Take an ISO date string of the form YYYY-MM-DDTHH:MM:SS.S
#     and convert it into an instance of datetime.datetime
#     """
#     try:
#         return datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S')
#     except ValueError:
#         try:
#             return datetime.datetime.strptime(s, '%Y-%m-%d')
#         except ValueError:
#             return datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%f')


import unittest
import datetime
import functools
import configman.config_manager as config_manager
from configman.datetime_util import datetime_from_ISO_string
from configman.option import Option
from configman.orderedset import OrderedSet
        from copy import deepcopy
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, division, print_function





#==============================================================================
class TestCase(unittest.TestCase):

    #--------------------------------------------------------------------------
    def test_Namespace_basics(self):
        namespace = config_manager.Namespace('doc string')
        namespace.alpha = 1
        my_birthday = datetime.datetime(1960, 5, 4, 15, 10)
        namespace.beta = my_birthday
        self.assertEqual(namespace.alpha.name, 'alpha')
        self.assertEqual(namespace.alpha.doc, None)
        self.assertEqual(namespace.alpha.default, 1)
        self.assertEqual(namespace.alpha.from_string_converter, int)
        self.assertEqual(namespace.alpha.value, 1)
        self.assertEqual(namespace.beta.name, 'beta')
        self.assertEqual(namespace.beta.doc, None)
        self.assertEqual(namespace.beta.default, my_birthday)
        self.assertEqual(
            namespace.beta.from_string_converter,

# Path: configman/datetime_util.py
# def datetime_from_ISO_string(s):
#     """ Take an ISO date string of the form YYYY-MM-DDTHH:MM:SS.S
#     and convert it into an instance of datetime.datetime
#     """
#     try:
#         return datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S')
#     except ValueError:
#         try:
#             return datetime.datetime.strptime(s, '%Y-%m-%d')
#         except ValueError:
#             return datetime.datetime.strptime(s, '%Y-%m-%dT%H:%M:%S.%f')


# Path: configman/tests/test_namespace.py
import unittest
import datetime
import functools
import configman.config_manager as config_manager
from configman.datetime_util import datetime_from_ISO_string
from configman.option import Option
from configman.orderedset import OrderedSet
        from copy import deepcopy

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import, division, print_function





#==============================================================================
class TestCase(unittest.TestCase):

    #--------------------------------------------------------------------------
    def test_Namespace_basics(self):
        namespace = config_manager.Namespace('doc string')
        namespace.alpha = 1
        my_birthday = datetime.datetime(1960, 5, 4, 15, 10)
        namespace.beta = my_birthday
        self.assertEqual(namespace.alpha.name, 'alpha')
        self.assertEqual(namespace.alpha.doc, None)
        self.assertEqual(namespace.alpha.default, 1)
        self.assertEqual(namespace.alpha.from_string_converter, int)
        self.assertEqual(namespace.alpha.value, 1)
        self.assertEqual(namespace.beta.name, 'beta')
        self.assertEqual(namespace.beta.doc, None)
        self.assertEqual(namespace.beta.default, my_birthday)
        self.assertEqual(
            namespace.beta.from_string_converter,

            datetime_from_ISO_string