File: test_flacunicode.py

package info (click to toggle)
pytaglib 3.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,136 kB
  • sloc: python: 429; makefile: 7
file content (28 lines) | stat: -rw-r--r-- 784 bytes parent folder | download
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
# -*- coding: utf-8 -*-
# Copyright 2011-2016 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_flac_supports_unicode_value(test_data):
    file = test_data("testöü.flac")
    tfile = taglib.File(file)
    tfile.tags["ARTIST"] = ["artøst 1", "artöst 2"]
    tfile.save()
    tfile.close()

    tfile = taglib.File(file)
    assert tfile.tags["ARTIST"] == ["artøst 1", "artöst 2"]
    tfile.close()


def test_flac_supports_unicode_key(test_file):
    tfile = test_file("testöü.flac")
    tfile.tags["HÄÜ"] = ["omg"]
    remaining = tfile.save()
    assert "HÄÜ" in remaining
    tfile.close()