def test_metadata_internal(): info = rage._parse_info(DATA) with open("%s/the_wire.xml" % os.path.dirname(__file__)) as in_: eps = dict(rage._extract_episodes(ElementTree.fromstring(in_.read()))) metadata = rage._metadata_internal(info, eps) assert isinstance(metadata, dict) for (key, val) in metadata.iteritems(): assert isinstance(key, tuple) assert len(key) == 2 assert isinstance(val, dict) (season, ep) = key assert val['track_number'] == ep assert val['episode_number'] == ep assert val['season_number'] == season assert val['disc_number'] == season
def test_parse_info_pre(): assert rage._parse_info(DATA) == rage._parse_info("<pre>" + DATA)
def test_parse_info(): info = rage._parse_info(DATA) assert isinstance(info, dict) assert "Show Name" in info