Added channel whitespace test

This commit is contained in:
StruckCroissant 2022-02-13 00:06:42 -06:00
parent d04a9c05d0
commit 9a1fe7323a

View file

@ -50,7 +50,7 @@ class TestVideoAPI(TestAPI):
new_channel = dict(
directory=channel_directory,
match_regex='asdf',
name='Example Channel 1',
name=' Example Channel 1 ',
url='https://example.com/channel1',
)
@ -67,6 +67,9 @@ class TestVideoAPI(TestAPI):
self.assertIsNotNone(created)
self.assertIsNotNone(created['id'])
# Channel name leading/trailing whitespace should be stripped
assert created['name'] == 'Example Channel 1'
# Channel directory should be relative to the media directory
assert not pathlib.Path(created['directory']).is_absolute(), \
f'Channel directory is absolute: {created["directory"]}'