def test_format_string(self): date = 'Tomorrow' with pytest.raises(AttributeError) as attr_err: format_date(date) assert attr_err.value.message == "'str' object has no attribute 'tm_wday'"
def test_format_none(self): date = None formated = format_date(date) assert formated == format_date(gmtime())
def test_format_int(self): date = 1482357361 formated = format_date(date) assert formated == 'Wed, 21-Dec-2016 21:56:01 GMT'
def test_format_datetime(self): date = datetime(2016, 12, 21, 21, 56, 01) formated = format_date(date) assert formated == 'Wed, 21-Dec-2016 21:56:01 GMT'
def test_format_timestamp(self): date = datetime.fromtimestamp(1482357361) formated = format_date(date) assert formated == 'Wed, 21-Dec-2016 22:56:01 GMT'