예제 #1
0
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
예제 #2
0
 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]
예제 #3
0
 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]
예제 #4
0
 def test_val(self, val):
     now = dt_parse(obj=val)
     assert isinstance(now, datetime)
예제 #5
0
 def test_val(self, val):
     """Pass."""
     now = tools.dt_parse(obj=val)
     assert isinstance(now, tools.datetime)