def parse_kv(key: str, value: Any) -> Any: """Parse time stamp into required format.""" for word in FIELDS_TIME: if word in key: try: return dt_parse(value).isoformat() except Exception: return value return value
def test_list(self): now = [format(dt_now())] now = dt_parse(obj=now) assert isinstance(now, list) assert [isinstance(x, datetime) for x in now]
def test_list(self): """Pass.""" now = [format(tools.dt_now())] now = tools.dt_parse(obj=now) assert isinstance(now, tools.LIST) assert [isinstance(x, tools.datetime) for x in now]
def test_val(self, val): now = dt_parse(obj=val) assert isinstance(now, datetime)
def test_val(self, val): """Pass.""" now = tools.dt_parse(obj=val) assert isinstance(now, tools.datetime)