File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -399,15 +399,19 @@ def test_int_long(self):
399399 assert f .messages [- 1 ].fields [1 ].raw_value == 1739.486328125
400400
401401 def test_fileish_types (self ):
402- """Test the constructor does the right thing when given different types"""
403- with FitFile (testfile ('Settings.FIT' )):
404- pass
405- with FitFile (open (testfile ("Settings.fit" ), 'rb' )):
406- pass
407- with FitFile (open (testfile ("Settings.fit" ), 'rb' ).read ()):
408- pass
409- with FitFile (io .BytesIO (open (testfile ("Settings.fit" ), 'rb' ).read ())):
402+ """Test the constructor does the right thing when given different types
403+ (specifically, test files with 8 characters, followed by an uppercase.FIT
404+ extension), which confused the fileish check on Python 2, see
405+ https://github.com/dtcooper/python-fitparse/issues/29#issuecomment-312436350
406+ for details"""
407+ with FitFile (testfile ('nametest.FIT' )):
410408 pass
409+ with open (testfile ("nametest.FIT" ), 'rb' ) as f :
410+ FitFile (f )
411+ with open (testfile ("nametest.FIT" ), 'rb' ) as f :
412+ FitFile (f .read ())
413+ with open (testfile ("nametest.FIT" ), 'rb' ) as f :
414+ FitFile (io .BytesIO (f .read ()))
411415
412416 def test_elemnt_bolt_developer_data_id_without_application_id (self ):
413417 """Test that a file without application id set inside developer_data_id is parsed
You can’t perform that action at this time.
0 commit comments