def test_convert_tree_with_accents(self):
        with TemporaryDirectory() as tmp:
            self.create_flac_file(join(tmp, '\xc3\xa9\xc3\xa8\xc3\xa0.flac'.decode('utf-8')))

            run(tmp, tmp, tmp)

            ok_(os.path.isfile(join(tmp, '\xc3\xa9\xc3\xa8\xc3\xa0.mp3'.decode('utf-8'))))
    def test_convert_tree_with_accents(self):
        with TemporaryDirectory() as tmp:
            self.create_flac_file(
                join(tmp, '\xc3\xa9\xc3\xa8\xc3\xa0.flac'.decode('utf-8')))

            run(tmp, tmp, tmp)

            ok_(
                os.path.isfile(
                    join(tmp, '\xc3\xa9\xc3\xa8\xc3\xa0.mp3'.decode('utf-8'))))
Exemplo n.º 3
0
    def test_convert_tree(self):
        with TemporaryDirectory() as tmp:
            for dir in ('/r1', '/r2/r21', '/r3', '/mp3'):
                if not isdir(tmp + dir):
                    makedirs(tmp + dir)
            self.create_flac_file(join(tmp, 'r1/f11.flac'))
            self.create_flac_file(join(tmp, 'r1/f12.flac'))
            self.create_flac_file(join(tmp, 'r2/r21/f21.flac'))

            run(join(tmp, 'mp3'), tmp, tmp)

            expected = (join(tmp, mp3) for mp3 in ("mp3/r1/f11.mp3", "mp3/r1/f12.mp3", "mp3/r2/r21/f21.mp3"))
            actual = list(find_files(".mp3", tmp))

            self.assertItemsEqual(actual, expected)
    def test_convert_tree(self):
        with TemporaryDirectory() as tmp:
            for dir in ('/r1', '/r2/r21', '/r3', '/mp3'):
                if not isdir(tmp + dir):
                    makedirs(tmp + dir)
            self.create_flac_file(join(tmp, 'r1/f11.flac'))
            self.create_flac_file(join(tmp, 'r1/f12.flac'))
            self.create_flac_file(join(tmp, 'r2/r21/f21.flac'))

            run(join(tmp, 'mp3'), tmp, tmp)

            expected = list(
                join(tmp, mp3) for mp3 in ("mp3/r1/f11.mp3", "mp3/r1/f12.mp3",
                                           "mp3/r2/r21/f21.mp3"))
            actual = list(find_files(".*.mp3", tmp))

            assert_equals(sorted(actual), sorted(expected))