Skip to content

Commit 230912b

Browse files
authored
Merge pull request #37 from flokli/test-fixes
Test fixes
2 parents de90d9a + 1636660 commit 230912b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

tests/files/nametest.FIT

1.26 KB
Binary file not shown.

tests/test.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)