예제 #1
0
    def test_move_album_into_self_subdir(self, album):
        destination = path.join(album.path, 'subdir')
        reorganize.move_album(album, destination)
        assert path.isdir(destination)
        assert album.path == destination

        pattern = path.join(destination, '{:0>2}.ogg')
        for track_path in [pattern.format(x, x) for x in range(5, 0, -1)]:
            assert path.isfile(track_path)
            assert path.dirname(track_path) == destination
예제 #2
0
    def test_move_album_into_dir(self, album):
        destination = tempfile.mkdtemp()
        folder_name = path.basename(album.path)
        reorganize.move_album(album, destination)
        album_path = path.join(destination, folder_name)
        assert path.isdir(destination)
        assert path.isdir(album_path)
        assert album.path == album_path

        pattern = path.join(album_path, '{:0>2}.ogg')
        for track_path in [pattern.format(x, x) for x in range(5, 0, -1)]:
            assert path.isfile(track_path)