Skip to content

Commit 8a6748d

Browse files
authored
fixes #91 (#103)
1 parent 7166302 commit 8a6748d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sox/file_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def file_extension(filepath):
326326
extension : str
327327
The file's extension
328328
'''
329-
return os.path.splitext(filepath)[1][1:]
329+
return os.path.splitext(filepath)[1][1:].lower()
330330

331331

332332
def info(filepath):

tests/test_file_info.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ def relpath(f):
1212
SPACEY_FILE = relpath("data/annoying filename (derp).wav")
1313
INPUT_FILE = relpath('data/input.wav')
1414
INPUT_FILE2 = relpath('data/input.aiff')
15+
INPUT_FILE3 = relpath('data/input.WAV')
1516
EMPTY_FILE = relpath('data/empty.wav')
1617
INPUT_FILE_INVALID = relpath('data/input.xyz')
1718
OUTPUT_FILE = relpath('data/output.wav')
@@ -33,6 +34,7 @@ def test_aiff(self):
3334
def test_empty(self):
3435
actual = file_info.bitrate(EMPTY_FILE)
3536
expected = None
37+
self.assertEqual(expected, actual)
3638

3739
class TestBitdepth(unittest.TestCase):
3840

@@ -233,6 +235,11 @@ def test_ext5(self):
233235
expected = 'x23zya'
234236
self.assertEqual(expected, actual)
235237

238+
def test_ext6(self):
239+
actual = file_info.file_extension('simplefile.MP3')
240+
expected = 'mp3'
241+
self.assertEqual(expected, actual)
242+
236243

237244
class TestInfo(unittest.TestCase):
238245

0 commit comments

Comments
 (0)