Beispiel #1
0
 def format(self, value):
     """Converts given epoch to iso8601 string"""
     return to_date_str(value)
Beispiel #2
0
def test_to_date_str_with_string_as_input() -> str:
    """Test invalid string as date."""
    assert to_date_str('abcd') == ''
Beispiel #3
0
def test_to_date_str_with_string_num_as_input() -> str:
    """Test number as input."""
    assert to_date_str('{}'.format(_TIMESTAMP)) == _STR
Beispiel #4
0
def test_to_date_str() -> str:
    """Test date to string."""
    assert to_date_str(_TIMESTAMP) == _STR
Beispiel #5
0
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
Beispiel #10
0
 def format(self, value):
     """Convert given epoch to iso8601 string."""
     return to_date_str(value) if value else None