示例#1
0
文件: helper.py 项目: syyunn/dart-fss
def cls_datetime_check(cls, start_dt, end_dt):
    """ classification 의 시간이 시작일자와 종료일자 사이인지 체크하는 함수

    Parameters
    ----------
    cls: cls
        classification
    start_dt: str
        검색 시작 일자
    end_dt: str
        검색 종료 일자

    Returns
    -------
    bool
        시작일자와 종료일자 사이에 있을시 True / 아닐시 False

    """
    res = True
    instant_datetime = cls.get('instant_datetime')
    if instant_datetime:
        res = res and check_datetime(instant_datetime, start_dt, end_dt)
    start_datetime = cls.get('start_datetime')
    if start_datetime:
        res = res and check_datetime(start_datetime, start_dt, end_dt)
    end_datetime = cls.get('end_datetime')
    if end_datetime:
        res = res and check_datetime(end_datetime, start_dt, end_dt)
    return res
示例#2
0
def test_check_datetime():
    actual = check_datetime('20191231', '20190101', '20190201')
    expected = False
    assert actual == expected