def testTagMainProps(): tag = Tag() # No version yet assert_equal(tag.version, ID3_DEFAULT_VERSION) assert_false(tag.isV1()) assert_true(tag.isV2()) assert_equal(tag.artist, None) tag.artist = u"Autolux" assert_equal(tag.artist, u"Autolux") assert_equal(len(tag.frame_set), 1) tag.artist = u"" assert_equal(len(tag.frame_set), 0) tag.artist = u"Autolux" assert_equal(tag.album, None) tag.album = u"Future Perfect" assert_equal(tag.album, u"Future Perfect") assert_equal(tag.album_artist, None) tag.album_artist = u"Various Artists" assert_equal(tag.album_artist, u"Various Artists") assert_equal(tag.title, None) tag.title = u"Robots in the Garden" assert_equal(tag.title, u"Robots in the Garden") assert_equal(tag.track_num, (None, None)) tag.track_num = 7 assert_equal(tag.track_num, (7, None)) tag.track_num = (7, None) assert_equal(tag.track_num, (7, None)) tag.track_num = (7, 15) assert_equal(tag.frame_set[frames.TRACKNUM_FID][0].text, "07/15") assert_equal(tag.track_num, (7, 15)) tag.track_num = (7, 150) assert_equal(tag.frame_set[frames.TRACKNUM_FID][0].text, "007/150") assert_equal(tag.track_num, (7, 150)) tag.track_num = (1, 7) assert_equal(tag.frame_set[frames.TRACKNUM_FID][0].text, "01/07") assert_equal(tag.track_num, (1, 7)) tag.track_num = None assert_equal(tag.track_num, (None, None)) tag.track_num = None, None
def testTagMainProps(): tag = Tag() # No version yet assert tag.version == ID3_DEFAULT_VERSION assert not (tag.isV1()) assert tag.isV2() assert tag.artist is None tag.artist = u"Autolux" assert tag.artist == u"Autolux" assert len(tag.frame_set) == 1 tag.artist = u"" assert len(tag.frame_set) == 0 tag.artist = u"Autolux" assert tag.album is None tag.album = u"Future Perfect" assert tag.album == u"Future Perfect" assert tag.album_artist is None tag.album_artist = u"Various Artists" assert (tag.album_artist == u"Various Artists") assert (tag.title is None) tag.title = u"Robots in the Garden" assert (tag.title == u"Robots in the Garden") assert (tag.track_num == (None, None)) tag.track_num = 7 assert (tag.track_num == (7, None)) tag.track_num = (7, None) assert (tag.track_num == (7, None)) tag.track_num = (7, 15) assert (tag.frame_set[frames.TRACKNUM_FID][0].text == "07/15") assert (tag.track_num == (7, 15)) tag.track_num = (7, 150) assert (tag.frame_set[frames.TRACKNUM_FID][0].text == "007/150") assert (tag.track_num == (7, 150)) tag.track_num = (1, 7) assert (tag.frame_set[frames.TRACKNUM_FID][0].text == "01/07") assert (tag.track_num == (1, 7)) tag.track_num = None assert (tag.track_num == (None, None)) tag.track_num = None, None
def testTagMainProps(): tag = Tag() # No version yet assert tag.version == ID3_DEFAULT_VERSION assert not(tag.isV1()) assert tag.isV2() assert tag.artist is None tag.artist = "Autolux" assert tag.artist == "Autolux" assert len(tag.frame_set) == 1 tag.artist = "" assert len(tag.frame_set) == 0 tag.artist = "Autolux" assert tag.album is None tag.album = "Future Perfect" assert tag.album == "Future Perfect" assert tag.album_artist is None tag.album_artist = "Various Artists" assert (tag.album_artist == "Various Artists") assert (tag.title is None) tag.title = "Robots in the Garden" assert (tag.title == "Robots in the Garden") assert (tag.track_num == (None, None)) tag.track_num = 7 assert (tag.track_num == (7, None)) tag.track_num = (7, None) assert (tag.track_num == (7, None)) tag.track_num = (7, 15) assert (tag.frame_set[frames.TRACKNUM_FID][0].text == "07/15") assert (tag.track_num == (7, 15)) tag.track_num = (7, 150) assert (tag.frame_set[frames.TRACKNUM_FID][0].text == "007/150") assert (tag.track_num == (7, 150)) tag.track_num = (1, 7) assert (tag.frame_set[frames.TRACKNUM_FID][0].text == "01/07") assert (tag.track_num == (1, 7)) tag.track_num = None assert (tag.track_num == (None, None)) tag.track_num = None, None