def test_isoformat():
    """
    Tests that the unix_time function returns the correct value and fails gracefully for strange inputs
    """
    assert (
        isoformat(DateTime(2017, 1, 1, tzinfo=TimeZone.utc))
        == "2017-01-01T00:00:00+00:00Z"
    )
    assert isoformat(DateTime(2017, 1, 1)) == "2017-01-01T00:00:00Z"
    assert isoformat(DateTime(2017, 1, 1, tzinfo=None)) == "2017-01-01T00:00:00Z"
    assert isoformat(None) is None
    assert isoformat("test") is None
    assert isoformat(1) is None

    Tests that the unix_time function returns the correct value and fails gracefully for strange inputs
    
tests/utils/test_ctftime.py