def test_video():
 gif_path = os.path.join(BASE_DIRECTORY, 'artwork', 'example.gif')
 assert hasattr(hug.output_format.mp4_video(gif_path, hug.Response()), 'read')
 with open(gif_path, 'rb') as image_file:
  assert hasattr(hug.output_format.mp4_video(image_file, hug.Response()), 'read')
 assert (hug.output_format.mp4_video('Not Existent', hug.Response()) is None)
 class FakeVideoWithSave:
  def save(self, to, format):
   to.write('test')
 assert hasattr(hug.output_format.mp4_video(FakeVideoWithSave(), hug.Response()), 'read')
 class FakeVideoWithSave:
  def render(self):
   return 'test'
 assert (hug.output_format.avi_video(FakeVideoWithSave(), hug.Response()) == 'test')

def test_video ( ) : gif_path = os . path . join ( BASE_DIRECTORY , 'artwork' , 'example.gif' ) assert hasattr ( hug . output_format . mp4_video ( gif_path , hug . Response ( ) ) , 'read' ) with open ( gif_path , 'rb' ) as image_file : assert hasattr ( hug . output_format . mp4_video ( image_file , hug . Response ( ) ) , 'read' ) assert ( hug . output_format . mp4_video ( 'Not Existent' , hug . Response ( ) ) is None ) class FakeVideoWithSave : def save ( self , to , format ) : to . write ( 'test' ) assert hasattr ( hug . output_format . mp4_video ( FakeVideoWithSave ( ) , hug . Response ( ) ) , 'read' ) class FakeVideoWithSave : def render ( self ) : return 'test' assert ( hug . output_format . avi_video ( FakeVideoWithSave ( ) , hug . Response ( ) ) == 'test' )
ensure that its possible to output videos with hug .