mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-25 18:40:06 -04:00
Adding more comments. Testing that the orphan file isn't deleted.
This commit is contained in:
parent
7a1447207c
commit
dc4ce0bda1
2 changed files with 6 additions and 2 deletions
|
|
@ -19,7 +19,8 @@ well as its meta files) is relative to its Channel's directory.
|
|||
video['poster_path'] = 'foo.jpg'
|
||||
video['video_path'] = 'subdir/bar.mp4'
|
||||
|
||||
Relative DB paths allow files to be moved without having to rebuild the entire collection.
|
||||
Relative DB paths allow files to be moved without having to rebuild the entire collection. It also ensures that when
|
||||
a file is moved, it will not be duplicated in the DB.
|
||||
"""
|
||||
import json
|
||||
import pathlib
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@ class TestAPI(unittest.TestCase):
|
|||
description3 = pathlib.Path(channel_path / 'channel name_20000103_cdefghijklm_title.description')
|
||||
description3.touch()
|
||||
|
||||
# A orphan meta-file should be ignored. This shouldn't show up anywhere.
|
||||
# A orphan meta-file should be ignored. This shouldn't show up anywhere. But, it shouldn't be deleted.
|
||||
# WROLPi should never delete a file.
|
||||
poster3 = pathlib.Path(channel_path / 'channel name_20000104_defghijklmn_title.jpg')
|
||||
poster3.touch()
|
||||
|
||||
|
|
@ -183,3 +184,5 @@ class TestAPI(unittest.TestCase):
|
|||
{(i['video_path'], i['poster_path'], i['description_path']) for i in channel['videos']},
|
||||
expected
|
||||
)
|
||||
|
||||
assert poster3.is_file(), 'Orphan jpg file was deleted! WROLPi should never delete files.'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue