Esempio n. 1
0
 def format(self, value):
     """Converts given epoch to iso8601 string"""
     return to_date_str(value)
Esempio n. 2
0
def test_to_date_str_with_string_as_input() -> str:
    """Test invalid string as date."""
    assert to_date_str('abcd') == ''
Esempio n. 3
0
def test_to_date_str_with_string_num_as_input() -> str:
    """Test number as input."""
    assert to_date_str('{}'.format(_TIMESTAMP)) == _STR
Esempio n. 4
0
def test_to_date_str() -> str:
    """Test date to string."""
    assert to_date_str(_TIMESTAMP) == _STR
Esempio n. 5
0
def test_to_date_str_with_empty_string_as_input() -> str:
    """Test empty string."""
    assert to_date_str('') == ''
Esempio n. 6
0
def test_to_date_str_with_string_num_as_input() -> str:
    assert to_date_str('{}'.format(_TIMESTAMP)) == _STR
Esempio n. 7
0
def test_to_date_str_with_string_as_input() -> str:
    assert to_date_str('abcd') == ''
Esempio n. 8
0
def test_to_date_str_with_empty_string_as_input() -> str:
    assert to_date_str('') == ''
Esempio n. 9
0
def test_to_date_str() -> str:
    assert to_date_str(_TIMESTAMP) == _STR
Esempio n. 10
0
 def format(self, value):
     """Convert given epoch to iso8601 string."""
     return to_date_str(value) if value else None