def testUpdateCSV(self): desiredResult = [[ "'ARTIST', 'TITLE', 'URL', 'LIKES', 'DISLIKES', 'VIEWS', 'USED?', 'LIKES to TOTAL RATIO', " "'LIKES to DISLIKES RATIO', 'LIKES to VIEWS RATIO'" ], ['Test 0,Title,6cwBLBCehGg,0,0,0,False,0,0,0'], ['Test 1,Title,6cwBLBCehGg,0,0,0,False,0,0,0'], ['Test 2,Title,6cwBLBCehGg,0,0,0,False,0,0,0'], ['Test 3,Title,6cwBLBCehGg,0,0,0,False,0,0,0'], ['Test 4,Title,6cwBLBCehGg,0,0,0,False,0,0,0']] try: mht.clear() mht.updateCSV(-1) results = mht.readData() mht.clear() self.assertEqual(desiredResult, results) except AttributeError as e: error(str(e)) pass
print('Errors ', result.errors) pprint(result.failures) stream.seek(0) print('Test output\n', stream.read()) mh.saveData(dic) # return original data to csv elif userIN[0] == "read": # if wanting to read MusicData.csv mh.printRows(mh.readData()) elif userIN[ 0] == "clear": # if wishing to clear of create a new instance of MusicData.csv mh.clear() elif userIN[ 0] == "done": # if wishing to clear BASEPATH of *.mp3 files yt.doneConversion() elif userIN[ 0] == "update": # if wishing to update csv with new music info mh.updateCSV(0) elif userIN[0] == "mai": # if wanting to initiate MusicAI.py mai.train() elif userIN[0] == 'ae': ae.setTrack(userIN[1]) elif userIN[0] == "v": # if video v try: yt.downloading() yt.convertVid(userIN[1]) except yt.youtube_dl.utils.PostProcessingError and yt.youtube_dl.utils.DownloadError as e: yt.error(e) elif userIN[0] == "p": # if playlist p try: yt.downloading() yt.convertPlaylist(userIN[1]) except yt.youtube_dl.utils.PostProcessingError and yt.youtube_dl.utils.DownloadError as e: