Esempio n. 1
0
    def test_apic_duplicate_hash(self):
        id3 = ID3Tags()
        for i in xrange(10):
            apic = APIC(encoding=0, mime=u"b", type=3, desc=u"", data=b"a")
            id3._add(apic, False)

        self.assertEqual(len(id3), 10)
        for key, value in id3.items():
            self.assertEqual(key, value.HashKey)
Esempio n. 2
0
    def test_apic_duplicate_hash(self):
        id3 = ID3Tags()
        for i in xrange(10):
            apic = APIC(encoding=0, mime=u"b", type=3, desc=u"", data=b"a")
            id3._add(apic, False)

        self.assertEqual(len(id3), 10)
        for key, value in id3.items():
            self.assertEqual(key, value.HashKey)
Esempio n. 3
0
    def test_text_duplicate_frame_different_encoding(self):
        id3 = ID3Tags()
        frame = TPE2(encoding=Encoding.LATIN1, text=[u"foo"])
        id3._add(frame, False)
        assert id3.getall("TPE2")[0].encoding == Encoding.LATIN1
        frame = TPE2(encoding=Encoding.LATIN1, text=[u"bar"])
        id3._add(frame, False)
        assert id3.getall("TPE2")[0].encoding == Encoding.LATIN1
        frame = TPE2(encoding=Encoding.UTF8, text=[u"baz\u0400"])
        id3._add(frame, False)
        assert id3.getall("TPE2")[0].encoding == Encoding.UTF8

        frames = id3.getall("TPE2")
        assert len(frames) == 1
        assert len(frames[0].text) == 3
Esempio n. 4
0
    def test_text_duplicate_frame_different_encoding(self):
        id3 = ID3Tags()
        frame = TPE2(encoding=Encoding.LATIN1, text=[u"foo"])
        id3._add(frame, False)
        assert id3.getall("TPE2")[0].encoding == Encoding.LATIN1
        frame = TPE2(encoding=Encoding.LATIN1, text=[u"bar"])
        id3._add(frame, False)
        assert id3.getall("TPE2")[0].encoding == Encoding.LATIN1
        frame = TPE2(encoding=Encoding.UTF8, text=[u"baz\u0400"])
        id3._add(frame, False)
        assert id3.getall("TPE2")[0].encoding == Encoding.UTF8

        frames = id3.getall("TPE2")
        assert len(frames) == 1
        assert len(frames[0].text) == 3