File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff 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
332332def info (filepath ):
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ def relpath(f):
1212SPACEY_FILE = relpath ("data/annoying filename (derp).wav" )
1313INPUT_FILE = relpath ('data/input.wav' )
1414INPUT_FILE2 = relpath ('data/input.aiff' )
15+ INPUT_FILE3 = relpath ('data/input.WAV' )
1516EMPTY_FILE = relpath ('data/empty.wav' )
1617INPUT_FILE_INVALID = relpath ('data/input.xyz' )
1718OUTPUT_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
3739class 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
237244class TestInfo (unittest .TestCase ):
238245
You can’t perform that action at this time.
0 commit comments