mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-27 19:03:59 +00:00
Fix weird case
This commit is contained in:
@@ -170,7 +170,7 @@ def name_filter(record):
|
||||
path = path.resolve().relative_to(picard_module_path.parent)
|
||||
except ValueError:
|
||||
pass
|
||||
record.name = '/'.join(p for p in path.parts if p != '__init__')
|
||||
record.name = str(Path(*(p for p in path.parts if p != '__init__')))
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@@ -175,10 +175,10 @@ class NameFilterTestAbs(PicardTestCase):
|
||||
name_filter(record)
|
||||
|
||||
|
||||
@patch('picard.log.picard_module_path', PurePosixPath('/path1/path2/'))
|
||||
@patch('picard.log.picard_module_path', PurePosixPath('/path1/path2/')) # incorrect, but testing anyway
|
||||
class NameFilterTestEndingSlash(PicardTestCase):
|
||||
|
||||
def test_1(self):
|
||||
record = FakeRecord(name=None, pathname='/path3/module/file.py')
|
||||
self.assertTrue(name_filter(record))
|
||||
self.assertEqual(record.name, '//path3/module/file') # FIXME: incorrect picard_module_path, but this shouldn't happen
|
||||
self.assertEqual(record.name, '/path3/module/file')
|
||||
|
||||
Reference in New Issue
Block a user