<s> from django . test import TestCase <EOL> from video . management . commands . sub_commands . UploadCommitteesVideos import UploadCommitteesVideos <EOL> class UploadCommitteesVideo_test ( UploadCommitteesVideos ) : <EOL> def __init__ ( self , <EOL> testCase , allMmsVideos , isVideoAlreadyUploadedReturn , isAlreadyDownloadedReturn , <EOL> uploadVideoReturn , <EOL> ) : <EOL> self . _testCase = testCase <EOL> self . _allMmsVideos = allMmsVideos <EOL> self . _isVideoAlreadyUploadedReturn = isVideoAlreadyUploadedReturn <EOL> self . _isAlreadyDownloadedReturn = isAlreadyDownloadedReturn <EOL> self . _uploadVideoReturn = uploadVideoReturn <EOL> self . saveVideoLog = [ ] <EOL> self . deleteFileLog = [ ] <EOL> UploadCommitteesVideos . __init__ ( self , None ) <EOL> def _getAllMmsVideos ( self ) : <EOL> return self . _allMmsVideos <EOL> def _isVideoAlreadyUploaded ( self , video ) : <EOL> self . _testCase . assertIn ( video , self . _isVideoAlreadyUploadedReturn ) <EOL> return self . _isVideoAlreadyUploadedReturn [ video ] <EOL> def _isAlreadyDownloaded ( self , filename ) : <EOL> self . _testCase . assertIn ( filename , self . _isAlreadyDownloadedReturn ) <EOL> return self . _isAlreadyDownloadedReturn [ filename ] <EOL> def _uploadVideo ( self , filename , video ) : <EOL> self . _testCase . assertIn ( ( filename , video ) , self . _uploadVideoReturn ) <EOL> return self . _uploadVideoReturn [ ( filename , video ) ] <EOL> def _saveVideo ( self , videoFields ) : <EOL> self . saveVideoLog . append ( videoFields ) <EOL> def _deleteFile ( self , filename ) : <EOL> self . deleteFileLog . append ( filename ) <EOL> def _log ( self , * args , ** kwargs ) : <EOL> pass <EOL> def _check_timer ( self , * args , ** kwargs ) : pass <EOL> def _get_data_root ( self ) : <EOL> return '<STR_LIT>' <EOL> class Video_test ( ) : <EOL> def __init__ ( self , embed_link , title ) : <EOL> self . embed_link = embed_link <EOL> self . title = title <EOL> class testUploadCommitteesVideos ( TestCase ) : <EOL> maxDiff = None <EOL> def testUploadCommitteesVideos ( self ) : <EOL> videos = [ <EOL> Video_test ( <EOL> embed_link = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> ) , <EOL> Video_test ( <EOL> embed_link = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> ) , <EOL> Video_test ( <EOL> embed_link = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> ) , <EOL> Video_test ( <EOL> embed_link = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> ) , <EOL> Video_test ( <EOL> embed_link = '<STR_LIT>' , <EOL> title = '<STR_LIT>' , <EOL> ) , <EOL> ] <EOL> obj = UploadCommitteesVideo_test ( <EOL> self , <EOL> allMmsVideos = videos , <EOL> isVideoAlreadyUploadedReturn = { <EOL> videos [ <NUM_LIT:0> ] : True , <EOL> videos [ <NUM_LIT:1> ] : False , <EOL> videos [ <NUM_LIT:2> ] : False , <EOL> videos [ <NUM_LIT:3> ] : False , <EOL> videos [ <NUM_LIT:4> ] : False , <EOL> } , <EOL> isAlreadyDownloadedReturn = { <EOL> '<STR_LIT>' : False , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> } , <EOL> uploadVideoReturn = { <EOL> ( '<STR_LIT>' , videos [ <NUM_LIT:2> ] ) : ( False , '<STR_LIT:0>' ) , <EOL> ( '<STR_LIT>' , videos [ <NUM_LIT:3> ] ) : ( True , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , videos [ <NUM_LIT:4> ] ) : ( True , '<STR_LIT>' ) , <EOL> } , <EOL> ) <EOL> self . assertEqual ( obj . saveVideoLog , [ <EOL> { <EOL> '<STR_LIT>' : videos [ <NUM_LIT:3> ] , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:title>' : '<STR_LIT>' <EOL> } , <EOL> { <EOL> '<STR_LIT>' : videos [ <NUM_LIT:4> ] , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT:title>' : '<STR_LIT>' <EOL> } , <EOL> ] ) <EOL> self . assertEqual ( obj . deleteFileLog , [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] ) </s>
