def format(self, value): """Converts given epoch to iso8601 string""" return to_date_str(value)
def test_to_date_str_with_string_as_input() -> str: """Test invalid string as date.""" assert to_date_str('abcd') == ''
def test_to_date_str_with_string_num_as_input() -> str: """Test number as input.""" assert to_date_str('{}'.format(_TIMESTAMP)) == _STR
def test_to_date_str() -> str: """Test date to string.""" assert to_date_str(_TIMESTAMP) == _STR
def test_to_date_str_with_empty_string_as_input() -> str: """Test empty string.""" assert to_date_str('') == ''
def test_to_date_str_with_string_num_as_input() -> str: assert to_date_str('{}'.format(_TIMESTAMP)) == _STR
def test_to_date_str_with_string_as_input() -> str: assert to_date_str('abcd') == ''
def test_to_date_str_with_empty_string_as_input() -> str: assert to_date_str('') == ''
def test_to_date_str() -> str: assert to_date_str(_TIMESTAMP) == _STR
def format(self, value): """Convert given epoch to iso8601 string.""" return to_date_str(value) if value else None