Example #1
0
 def test_tag_text_types(self):
     for t in format_types:
         i = AudioFile.__new__(t)
         i["~filename"] = fsnative(u"foo")
         for tag in TAGS.values():
             name = tag.name
             # brute force
             variants = [
                 name, "~" + name, name + "sort", "~" + name + "sort",
                 name + ":role", "~" + name + ":role",
                 "~" + name + "sort:role", name + "sort:role",
             ]
             for name in variants:
                 if name in FILESYSTEM_TAGS:
                     assert isinstance(i(name, fsnative()), fsnative)
                 else:
                     assert isinstance(i(name), text_type)
 def test_tag_text_types(self):
     for t in format_types:
         i = AudioFile.__new__(t)
         i["~filename"] = fsnative(u"foo")
         for tag in TAGS.values():
             name = tag.name
             # brute force
             variants = [
                 name, "~" + name, name + "sort", "~" + name + "sort",
                 name + ":role", "~" + name + ":role",
                 "~" + name + "sort:role", name + "sort:role",
             ]
             for name in variants:
                 if name in FILESYSTEM_TAGS:
                     assert isinstance(i(name, fsnative()), fsnative)
                 else:
                     assert isinstance(i(name), text_type)