If no extentions FileBase.ext is now None

pull/12/head
Dan Puttick 2017-03-06 14:55:33 -05:00
parent b6c01db1fb
commit 1c58a7347e
2 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,10 @@ class FileBase(object):
def _determine_extension(self):
_, ext = os.path.splitext(self.src_path)
return ext.lower()
ext = ext.lower()
if ext == '':
ext = None
return ext
def _determine_mimetype(self):
if os.path.islink(self.src_path):

View File

@ -130,7 +130,6 @@ class TestFileBase:
def test_has_extension(self, temp_file, temp_file_no_ext):
assert temp_file.has_extension() is True
assert temp_file_no_ext.has_extension() is False
assert temp_file_no_ext.log_details.get('no_extension') is True
def test_add_log_details(self, generic_conf_file):
generic_conf_file.add_log_details('test', True)