# Path: tests/util.py
# def dt(dtstr):  # (parse datetime str)
#     """
#     Return datetime parsed from str of various accepted formats, eg:
#       - '2014-02-14 16:30:45 001234'
#       - '2014-02-14 16:30:45'
#       - '2014-02-14 16:30'
#       - '2014-02-14'
#     Raise ValueError if not recognizable.
#     """
#     FORMATS = (
#         '%Y-%m-%d %H:%M:%S %f',
#         '%Y-%m-%d %H:%M:%S',
#         '%Y-%m-%d %H:%M',
#         '%Y-%m-%d',
#     )
#     for fmt in FORMATS:
#         try:
#             dt1 = datetime.strptime(dtstr, fmt)
#             return dt1
#         except ValueError as e:
#             pass
#     raise ValueError("time data '{dtstr}' does not match any format"
#         .format(dtstr=dtstr))


import pytest
import axonchisel.metrics.foundation.metricdef.metricdef as metricdef
import axonchisel.metrics.foundation.chrono.timerange as timerange
import axonchisel.metrics.foundation.chrono.framespec as framespec
import axonchisel.metrics.foundation.chrono.ghost as ghost
import axonchisel.metrics.foundation.data.point as point
import axonchisel.metrics.foundation.data.series as series
import axonchisel.metrics.foundation.data.multi as multi
import axonchisel.metrics.foundation.query.query as query
import axonchisel.metrics.foundation.query.qdata as qdata
from datetime import datetime
from .util import dt

Note: 'conftest.py' is a magic filename used by py.test.

------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""


# ----------------------------------------------------------------------------







# ----------------------------------------------------------------------------
# Basic fixtures


@pytest.fixture
def dts():
    """Fixture with common datetime objects."""
    return [
        dt('2014-02-01'),
        dt('2014-03-01'),
        dt('2014-04-14 16:42:45'), # (monday)
        dt('2014-04-15 16:42:45'), # (tuesday)
        dt('2014-02-14 16:30:45 001234'), # (friday)

# Path: tests/util.py
# def dt(dtstr):  # (parse datetime str)
#     """
#     Return datetime parsed from str of various accepted formats, eg:
#       - '2014-02-14 16:30:45 001234'
#       - '2014-02-14 16:30:45'
#       - '2014-02-14 16:30'
#       - '2014-02-14'
#     Raise ValueError if not recognizable.
#     """
#     FORMATS = (
#         '%Y-%m-%d %H:%M:%S %f',
#         '%Y-%m-%d %H:%M:%S',
#         '%Y-%m-%d %H:%M',
#         '%Y-%m-%d',
#     )
#     for fmt in FORMATS:
#         try:
#             dt1 = datetime.strptime(dtstr, fmt)
#             return dt1
#         except ValueError as e:
#             pass
#     raise ValueError("time data '{dtstr}' does not match any format"
#         .format(dtstr=dtstr))


# Path: tests/conftest.py
import pytest
import axonchisel.metrics.foundation.metricdef.metricdef as metricdef
import axonchisel.metrics.foundation.chrono.timerange as timerange
import axonchisel.metrics.foundation.chrono.framespec as framespec
import axonchisel.metrics.foundation.chrono.ghost as ghost
import axonchisel.metrics.foundation.data.point as point
import axonchisel.metrics.foundation.data.series as series
import axonchisel.metrics.foundation.data.multi as multi
import axonchisel.metrics.foundation.query.query as query
import axonchisel.metrics.foundation.query.qdata as qdata
from datetime import datetime
from .util import dt


Note: 'conftest.py' is a magic filename used by py.test.

------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""


# ----------------------------------------------------------------------------







# ----------------------------------------------------------------------------
# Basic fixtures


@pytest.fixture
def dts():
    """Fixture with common datetime objects."""
    return [
        dt('2014-02-01'),
        dt('2014-03-01'),
        dt('2014-04-14 16:42:45'), # (monday)
        dt('2014-04-15 16:42:45'), # (tuesday)
        dt('2014-02-14 16:30:45 001234'), # (friday)

        dt('2014-04-14 16:42:45 001234'), # (monday)