LittleDevMars / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
0 stars 0 forks source link

Test failure: test_use_gmt_times #287

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I just tried doing 'make test' and test_use_gmt_times fails on both Python2.7.3 
and Python3.2.3 with:
======================================================================
FAIL: test_use_gmt_times (__main__.TestConfigurableOptions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_ftpd.py", line 2536, in test_use_gmt_times
    self.assertEqual(gmt1, loc1)
AssertionError: '213 20140412075452' != '213 20140412085452'

Seems like the test needs to be updated to take DST into account? If it helps, 
here's the output of various fields from the time module:

>>> time.localtime()
time.struct_time(tm_year=2014, tm_mon=4, tm_mday=12, tm_hour=8, tm_min=42, 
tm_sec=55, tm_wday=5, tm_yday=102, tm_isdst=1)
>>> time.gmtime()
time.struct_time(tm_year=2014, tm_mon=4, tm_mday=12, tm_hour=7, tm_min=43, 
tm_sec=1, tm_wday=5, tm_yday=102, tm_isdst=0)
>>> time.timezone
0
>>> time.tzname
('GMT', 'BST')
>>> time.daylight
1

Original issue reported on code.google.com by gc...@loowis.durge.org on 12 Apr 2014 at 7:57

GoogleCodeExporter commented 9 years ago
Mmmm... not sure how to fix that. Do you?

Original comment by g.rodola on 12 Apr 2014 at 9:17

GoogleCodeExporter commented 9 years ago
Well, the attached patch fixes the problem for me, but ideally we'd want it 
tested by people in different timezones before committing it.

Original comment by gc...@loowis.durge.org on 12 Apr 2014 at 9:58

Attachments: