def testReadFilesFromDirectory(self): fetched_songs = read_files_from_directory(r"songs/zouk") self.assertItemsEqual( [os.path.normpath("songs/zouk/zouk2.mp3"), os.path.normpath("songs/zouk/zouk1.mp3")], fetched_songs )
def testReadFilesFromDirectory_DirectoryDoesNotExist(self): self.assertEqual(list(), read_files_from_directory("inexistent_dir")) self.assertEqual(list(), read_files_from_directory(""))
def testReadFilesFromDirectory_IsRecursive(self): fetched_songs = read_files_from_directory(r"songs/samba") self.assertItemsEqual( [os.path.normpath("songs/samba/lento/samba_lento1.mp3"), os.path.normpath("songs/samba/rapido/samba_rapido1.mp3")], fetched_songs)
def testReadFilesFromDirectory_IsRecursive(self): fetched_songs = read_files_from_directory(r"songs/samba") self.assertItemsEqual([ os.path.normpath("songs/samba/lento/samba_lento1.mp3"), os.path.normpath("songs/samba/rapido/samba_rapido1.mp3") ], fetched_songs)
def testReadFilesFromDirectory(self): fetched_songs = read_files_from_directory(r"songs/zouk") self.assertItemsEqual([ os.path.normpath("songs/zouk/zouk2.mp3"), os.path.normpath("songs/zouk/zouk1.mp3") ], fetched_songs)