1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
# -*- coding: utf-8 -*-
# Copyright 2011-2017 Michael Helmling
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation
#
import taglib
def test_cyrillic_file_name(test_file):
"""Motivated by https://github.com/supermihi/pytaglib/issues/28."""
tfile = test_file("Жбж.mp3")
tfile.tags["COMMENT"] = ["test"]
tfile.save()
tfile.close()
def test_accepts_bytes_keys_and_values(test_data):
f = test_data("rare_frames.mp3")
tf = taglib.File(f)
tf.tags[b"BYTES"] = [b"OnE", b"twO"]
tf.save()
tf.close()
tf = taglib.File(f)
assert tf.tags["BYTES"] == ["OnE", "twO"]
tf.close()
def test_accepts_unicode_keys_and_tags(test_data):
f = test_data("rare_frames.mp3")
tf = taglib.File(f)
tf.tags["UNICODE"] = ["OnE", "twO"]
tf.save()
tf.close()
tf = taglib.File(f)
assert tf.tags["UNICODE"] == ["OnE", "twO"]
tf.close()
|