mirror of https://github.com/CIRCL/PyCIRCLean
If no extentions FileBase.ext is now None
parent
b6c01db1fb
commit
1c58a7347e
|
@ -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):
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue