Test get_short_name_of_transcoding_type()

This commit is contained in:
2020-05-09 10:42:06 +02:00
parent 63ce1078e4
commit e1aff0c7a1

View File

@@ -0,0 +1,12 @@
from django.test import TestCase
from videodinges.models import TranscodingType, get_short_name_of_transcoding_type
class GetShortNameOfTranscodingTypeTestCase(TestCase):
def test_gets_transcoding_by_name(self):
result = get_short_name_of_transcoding_type('video/webm; codecs="vp8, vorbis"')
self.assertEqual(result, 'vp8')
def test_gets_transcoding_by_transcoding_object(self):
result = get_short_name_of_transcoding_type(TranscodingType(name='Looooong naaaaame', short_name='shrt nm'))
self.assertEqual(result, 'shrt nm')