#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2011-2015 Slack
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from django.test import TestCase as TestCaseBase
from .scraper import beatport, discogs, itunes, junodownload, metalarchives, musicbrainz, bandcamp, musiksammler
from .result import ReleaseResult, ListResult, NotFoundResult, Result
import unittest


def todict(obj):
    if hasattr(obj, "__iter__"):
        return [todict(v) for v in obj]
    elif hasattr(obj, "__dict__"):
        return dict([(key, todict(value))
                     for key, value in obj.__dict__.iteritems()
                     if not callable(value) and not key.startswith('_')])
    else:
        return obj


class TestCase(TestCaseBase):

    maxDiff = None

    def setUp(self):
        self.addTypeEqualityFunc(ReleaseResult, 'assertResultEqual')
        self.addTypeEqualityFunc(ListResult, 'assertResultEqual')
        self.addTypeEqualityFunc(NotFoundResult, 'assertResultEqual')

    def assertResultEqual(self, d1, d2, msg=None):
        self.assertTrue(issubclass(d1.__class__, Result), 'First argument is not a Result')
        self.assertTrue(issubclass(d2.__class__, Result), 'Second argument is not a Result')

        self.assertEqual(d1.__class__.__name__, d2.__class__.__name__)
        self.assertEqual(todict(d1), todict(d2), msg)


class DiscogsTest(TestCase):

    def test_simple_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'03 Nov 2000')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album')

        label_id = expected.create_label_id()
        label_id.set_label(u'Richterskala')
        label_id.append_catalogue_nr(u'TRI 070 CD')
        expected.append_label_id(label_id)

        expected.set_title(u'Hast Du Mich Vermisst?')

        artist = expected.create_artist()
        artist.set_name(u'ASP')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Rock')

        expected.append_style(u'Goth Rock')
        expected.append_style(u'Synth-pop')

        expected.set_url(u'http://www.discogs.com/ASP-Hast-Du-Mich-Vermisst/release/453432')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Schwarzer Schmetterling')
        track.set_length(290)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Where Do The Gods Go')
        track.set_length(226)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Dancing')
        track.set_length(345)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'K\xfcss Mich')
        track.set_length(311)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Sing Child')
        track.set_length(239)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Teach Me War')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Imbecile Anthem')
        track.set_length(222)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Und Wir Tanzten (Ungeschickte Liebesbriefe)')
        track.set_length(305)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Blinded')
        track.set_length(443)
        disc.append_track(track)

        expected.append_disc(disc)

        scraper = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/ASP-Hast-Du-Mich-Vermisst/release/453432')
        result = scraper.get_result()

        self.assertEqual(expected, result)

    def test_multiple_cds(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'25 May 2007')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'4 \xd7 CD, Compilation, Limited Edition, Digipak, Box Set, Limited Edition, Hand-Numbered')

        label_id = expected.create_label_id()
        label_id.set_label(u'[Trisol] Music Group GmbH')
        label_id.append_catalogue_nr(u'TRI 303 CD')
        expected.append_label_id(label_id)

        expected.set_title(u"The 'Once In A Lifetime' Recollection Box")

        artist = expected.create_artist()
        artist.set_name(u'ASP')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name(u'Chamber')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Classical')
        expected.append_genre(u'Non-Music')
        expected.append_genre(u'Rock')

        expected.append_style(u'Acoustic')
        expected.append_style(u'Goth Rock')
        expected.append_style(u'Classical')
        expected.append_style(u'Speech')

        expected.set_url(u'http://www.discogs.com/ASP-Chamber-The-Once-In-A-Lifetime-Recollection-Box/release/977684')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Once In A Lifetime, Part 1')
        track.set_length(351)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u"A Dead Man's Song")
        track.set_length(312)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Versuchung')
        track.set_length(345)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Torn')
        track.set_length(304)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Demon Love')
        track.set_length(272)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'The Paperhearted Ghost')
        track.set_length(283)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'A Tale Of Real Love')
        track.set_length(316)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Hunger')
        track.set_length(289)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'The Truth About Snow-White')
        track.set_length(240)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'She Wore Shadows')
        track.set_length(275)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Und Wir Tanzten (Ungeschickte Liebesbriefe)')
        track.set_length(317)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Once In A Lifetime, Part 2 (Reprise)')
        track.set_length(164)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'K\xfcss Mich')
        track.set_length(384)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Silence - Release')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Solitude')
        track.set_length(220)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Die Ballade Von Der Erweckung')
        track.set_length(527)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Another Conversation')
        track.set_length(201)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Sing Child')
        track.set_length(449)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Ich Will Brennen')
        track.set_length(300)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Toscana')
        track.set_length(374)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Ride On')
        track.set_length(222)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Hometown')
        track.set_length(181)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Werben')
        track.set_length(293)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Once In A Lifetime, Part 3 (Finale)')
        track.set_length(608)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(3)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'H\xe4sslich')
        track.set_length(145)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Backstage (All Areas)')
        track.set_length(573)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Paracetamoltr\xe4ume')
        track.set_length(517)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Ausszug Aus "Tremendista" Feat. Ralph M\xfcller/Gitarre')
        track.set_length(1473)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Campari O')
        track.set_length(159)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(4)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Asp, Soundcheck-Outtake: "Sicamore Trees"')
        track.set_length(94)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Demon Love')
        track.set_length(275)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'The Truth About Snow-White')
        track.set_length(274)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'She Wore Shadows')
        track.set_length(319)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Sing Child')
        track.set_length(469)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Hometown')
        track.set_length(221)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Hunger')
        track.set_length(274)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Silence-Release')
        track.set_length(208)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Asp, Soundcheck-Outtake: "She Moved Through The Fair"')
        track.set_length(120)
        disc.append_track(track)

        expected.append_disc(disc)

        scraper = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/ASP-Chamber-The-Once-In-A-Lifetime-Recollection-Box/release/977684')
        result = scraper.get_result()

        self.assertEqual(expected, result)

    def test_featuring_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'01 Apr 2011')
        release_event.set_country(u'Europe')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album')

        label_id = expected.create_label_id()
        label_id.set_label(u'Rootdown Records')
        label_id.append_catalogue_nr(u'RDM13074-2')
        expected.append_label_id(label_id)

        expected.set_title(u'Unter Freunden')

        artist = expected.create_artist()
        artist.set_name(u'Mono & Nikitaman')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Reggae')

        expected.append_style(u'Dancehall')

        expected.set_url(u'http://www.discogs.com/Mono-Nikitaman-Unter-Freunden/release/3432154')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Intro')
        track.set_length(13)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Unter Freunden')
        track.set_length(184)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Karma')
        track.set_length(189)
        track_artist = expected.create_artist()
        track_artist.set_name(u"Ce'cile")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Zeit Steht Still')
        track.set_length(260)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Komplizen')
        track.set_length(185)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Wenn Sich Der Nebel Verzieht')
        track.set_length(197)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Gentleman')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Schwerelos')
        track.set_length(227)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Ein Paar Meter')
        track.set_length(198)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Cash')
        track.set_length(188)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Dezibel')
        track.set_length(270)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Kontrast')
        track.set_length(214)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'R\xfcckkehr Der Clowns')
        track.set_length(198)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Superstar')
        track.set_length(227)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Underground')
        track.set_length(204)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Showdown')
        track.set_length(261)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Rebellion')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        scraper = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Mono-Nikitaman-Unter-Freunden/release/3432154')
        result = scraper.get_result()

        self.assertEqual(expected, result)

    def test_remix_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'04 Jul 2005')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album, Limited Edition, Digibook, CD, Compilation, Limited Edition')

        label_id = expected.create_label_id()
        label_id.set_label(u'Trisol')
        label_id.append_catalogue_nr(u'TRI 231 CD')
        expected.append_label_id(label_id)

        expected.set_title(u'Aus Der Tiefe')

        artist = expected.create_artist()
        artist.set_name(u'ASP')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Rock')

        expected.append_style(u'Alternative Rock')

        expected.set_url(u'http://www.discogs.com/ASP-Aus-Der-Tiefe-Der-Schwarze-Schmetterling-IV/release/710517')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Beschw\xf6rung')
        track.set_length(391)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Willkommen Zur\xfcck')
        track.set_length(137)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Schwarzes Blut')
        track.set_length(212)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Im Dunklen Turm')
        track.set_length(101)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Me')
        track.set_length(278)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Schattenschreie')
        track.set_length(21)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Hunger')
        track.set_length(321)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Fremde Erinnerungen')
        track.set_length(72)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Ballade Von Der Erweckung')
        track.set_length(533)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Tiefenrausch')
        track.set_length(245)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Schmetterling, Du Kleines Ding')
        track.set_length(42)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Ich Komm Dich Holn')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Werben')
        track.set_length(268)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Aus Der Tiefe')
        track.set_length(198)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Spiegelaugen')
        track.set_length(204)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Tiefenrausch (Reprise)')
        track.set_length(67)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'Panik')
        track.set_length(252)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title(u'Spiegel')
        track.set_length(331)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Schwarzes Blut (Haltung Version)')
        track.set_length(249)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Werben (Subtil Edit)')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Me (Single Version)')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Tiefenrausch (Feat. Sara Noxx)')
        track.set_length(245)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sara Noxx')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Hunger (Single Mix)')
        track.set_length(259)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Panik (Ganz Rauf-Verison)')
        track.set_length(273)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Beschw\xf6rung (Siegeszug Instrumental)')
        track.set_length(205)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Buch Des Vergessens (Unreines Spiegelsonett)')
        track.set_length(115)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Kokon (Brandneu-Remix Von Umbra Et Imago)')
        track.set_length(279)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Umbra Et Imago')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Me (Me And You Remix Von Blutengel)')
        track.set_length(344)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Blutengel')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Und Wir Tanzten (Ungeschickte Liebesbriefe) (Live)')
        track.set_length(347)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Ich Will Brennen (Live)')
        track.set_length(369)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Starfucker: In Der Folterkammer')
        track.set_length(127)
        disc.append_track(track)

        expected.append_disc(disc)

        scraper = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/ASP-Aus-Der-Tiefe-Der-Schwarze-Schmetterling-IV/release/710517')
        result = scraper.get_result()

        self.assertEqual(expected, result)

    def test_vinyl(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2008')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'2 \xd7 Vinyl, LP')

        label_id = expected.create_label_id()
        label_id.set_label(u'Rootdown Records')
        label_id.append_catalogue_nr(u'RDM 13051-1')
        expected.append_label_id(label_id)

        expected.set_title(u'Ausser Kontrolle')

        artist = expected.create_artist()
        artist.set_name(u'Mono & Nikitaman')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Reggae')

        expected.append_style(u'Dancehall')
        expected.append_style(u'Reggae-Pop')

        expected.set_url(u'http://www.discogs.com/Mono-Nikitaman-Ausser-Kontrolle/release/1540929')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'A1')
        track.set_title(u'Intro')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'A2')
        track.set_title(u'Schlag Alarm')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'A3')
        track.set_title(u'Kann Ja Mal Passieren')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'A4')
        track.set_title(u'Ausser Kontrolle')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'A5')
        track.set_title("Hol's Dir")
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'B1')
        track.set_title(u'Das Alles')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'B2')
        track.set_title(u'Digge Digge')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'B3')
        track.set_title(u'Nur So')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'B4')
        track.set_title(u'Yeah')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'C1')
        track.set_title(u'Von Osten Bis Westen')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Russkaja')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'C2')
        track.set_title(u'Wenn Ihr Schlaft')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'C3')
        track.set_title(u'Unterwegs')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'C4')
        track.set_title(u'Tiktak')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'D1')
        track.set_title(u'Tut Mir Leid')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Nosliw')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'D2')
        track.set_title(u'Es Kommt Anders')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'D3')
        track.set_title(u'Das Alles (Zion Train Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zion Train')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Mono-Nikitaman-Ausser-Kontrolle/release/1540929')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_featuring_main_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'08 Feb 2011')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'3 \xd7 File, MP3, 320 kbps')

        label_id = expected.create_label_id()
        label_id.set_label(u'Redux Recordings')
        label_id.append_catalogue_nr(u'RDX062')
        expected.append_label_id(label_id)

        expected.set_title(u'In My Dreams')

        artist = expected.create_artist()
        artist.set_name(u'Lifted Emotion')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name(u'Anastasiia Purple')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.FEATURING)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')

        expected.append_style(u'Trance')

        expected.set_url(u'http://www.discogs.com/Lifted-Emotion-feat-Anastasiia-Purple-In-My-Dreams/release/2806179')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'In My Dreams (Original Vocal Mix)')
        track.set_length(558)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'In My Dreams (Original Dub Mix)')
        track.set_length(558)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'In My Dreams (Ost & Meyer Extraodinary Mix)')
        track.set_length(472)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ost & Meyer')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Lifted-Emotion-feat-Anastasiia-Purple-In-My-Dreams/release/2806179')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_various_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2010')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Compilation')

        label_id = expected.create_label_id()
        label_id.set_label(u'Batbeliever Releases')
        label_id.append_catalogue_nr(u'BAT 075')
        expected.append_label_id(label_id)

        expected.set_title(u'Gothic File 14')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Rock')

        expected.append_style(u'EBM')
        expected.append_style(u'Darkwave')
        expected.append_style(u'Industrial')
        expected.append_style(u'Goth Rock')
        expected.append_style(u'Electro')

        expected.set_url(u'http://www.discogs.com/Various-Gothic-File-14/release/3700493')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Echo In Me')
        track.set_length(236)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Diary Of Dreams')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Liar (Version)')
        track.set_length(219)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Gothminister')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'The End Of It All (Edit)')
        track.set_length(237)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sirenia')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Sanctuary')
        track.set_length(239)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Merciful Nuns')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Worlds Collide (Demo Version)')
        track.set_length(261)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Covenant')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Drowning World')
        track.set_length(253)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ien Oblique')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'In The Name Of God')
        track.set_length(297)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Betamorphose')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'PsychoCop (Folge 8)')
        track.set_length(171)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Don Harris')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Various-Gothic-File-14/release/3700493')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_label_with_suffix(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'25 Nov 2005')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album')

        label_id = expected.create_label_id()
        label_id.set_label(u'Indigo')
        label_id.append_catalogue_nr(u'CD 55182')
        expected.append_label_id(label_id)

        expected.set_title(u'Prima Nocte')

        artist = expected.create_artist()
        artist.set_name(u'Feuerschwanz')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Folk')
        expected.append_genre(u'World')
        expected.append_genre(u'Country')
        expected.append_genre(u'Rock')

        expected.append_style(u'Medieval')

        expected.set_url(u'http://www.discogs.com/Feuerschwanz-Prima-Nocte/release/2611694')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Es War Einmal')
        track.set_length(172)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Das Mittelalter')
        track.set_length(260)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Drachentanz')
        track.set_length(224)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Das Turnier')
        track.set_length(254)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Prima Nocte')
        track.set_length(331)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'B\xe4rentanz')
        track.set_length(232)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Herren Der Winde')
        track.set_length(265)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Der Teufel')
        track.set_length(290)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Schneewittchen')
        track.set_length(377)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Der Traum')
        track.set_length(319)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'R\xe4uber')
        track.set_length(206)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Sauflied')
        track.set_length(234)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Teufelsgeschenk')
        track.set_length(264)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'La\xdft Die Ritter Schlafen')
        track.set_length(313)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Gute Nacht')
        track.set_length(420)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Feuerschwanz-Prima-Nocte/release/2611694')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_album_with_unicode_dash_in_title(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'25 Jun 2012')
        release_event.set_country(u'UK')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album')

        label_id = expected.create_label_id()
        label_id.set_label(u'Ash International')
        label_id.append_catalogue_nr(u'Ash 9.5')
        expected.append_label_id(label_id)

        expected.set_title(u'AUN \u2013 The Beginning And The End Of All Things')

        artist = expected.create_artist()
        artist.set_name(u'Christian Fennesz')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Stage & Screen')

        expected.append_style(u'Abstract')
        expected.append_style(u'Ambient')
        expected.append_style(u'Modern Classical')
        expected.append_style(u'Soundtrack')

        expected.set_url(u'http://www.discogs.com/Christian-Fennesz-AUN-The-Beginning-And-The-End-Of-All-Things/release/2881000')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Kae')
        track.set_length(131)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Aware')
        track.set_length(288)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Fennesz Sakamoto')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Haru')
        track.set_length(282)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Fennesz Sakamoto')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Sekai')
        track.set_length(134)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Euclides')
        track.set_length(184)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Sasazuka')
        track.set_length(231)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Trace')
        track.set_length(349)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Fennesz Sakamoto')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Mori')
        track.set_length(75)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'AUN40')
        track.set_length(306)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Namuru')
        track.set_length(170)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Himitsu')
        track.set_length(166)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'AUN80')
        track.set_length(217)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Nympha')
        track.set_length(150)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Shinu')
        track.set_length(215)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Hikari')
        track.set_length(256)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Christian Fennesz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Christian-Fennesz-AUN-The-Beginning-And-The-End-Of-All-Things/release/2881000')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_master_release(self):
        expected = ListResult()
        expected.set_scraper_name(None)

        item = expected.create_item()
        item.set_name(u'Mystic Matt & Anthill Mob \u2013 Burning')
        item.set_info(u'10", Pic, Ltd | Love Peace And Unity Recordings | LOVE-03 | UK | 1997')
        item.set_query(u'http://www.discogs.com/release/146468')
        item.set_url(u'http://www.discogs.com/release/146468')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Mystic Matt & Anthill Mob \u2013 Burning')
        item.set_info(u'10", Pic, Ltd, S/Sided | Love Peace And Unity Recordings | LOVE-03 | UK | 1997')
        item.set_query(u'http://www.discogs.com/release/1503116')
        item.set_url(u'http://www.discogs.com/release/1503116')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Mystic Matt & Anthill Mob \u2013 Burning')
        item.set_info(u'12", Ltd, Pic | Love Peace And Unity Recordings | LOVE-06 | UK | 2006-04-18')
        item.set_query(u'http://www.discogs.com/release/670448')
        item.set_url(u'http://www.discogs.com/release/670448')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Mystic Matt & Anthill Mob \u2013 Burnin')
        item.set_info(u'12", Promo | Classic Confetti | CC 02 | UK | 2001')
        item.set_query(u'http://www.discogs.com/release/2093234')
        item.set_url(u'http://www.discogs.com/release/2093234')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u"Mystic Matt & Anthill Mob \u2013 'Burnin (Let The Music)'")
        item.set_info(u'12" | Classic Confetti | CC 02 (2) | UK | 2001')
        item.set_query(u'http://www.discogs.com/release/284437')
        item.set_url(u'http://www.discogs.com/release/284437')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Mystic Matt & Anthill Mob \u2013 Burnin')
        item.set_info(u'12" | Classic Confetti | CC 02 | UK | 2001')
        item.set_query(u'http://www.discogs.com/release/149302')
        item.set_url(u'http://www.discogs.com/release/149302')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Mystic Matt & Anthill Mob \u2013 Burnin')
        item.set_info(u'12" | Classic Confetti | CC02(3F/02) | UK & Europe | 2002')
        item.set_query(u'http://www.discogs.com/release/739159')
        item.set_url(u'http://www.discogs.com/release/739159')
        expected.append_item(item)

        s = discogs.MasterScraper.from_string('http://www.discogs.com/Mystic-Matt-Anthill-Mob-Burning/master/181860')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_album_with_face_in_track_numbers(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'1984')
        release_event.set_country(u'Sweden')
        expected.append_release_event(release_event)

        expected.set_format(u'Vinyl, 7"')

        label_id = expected.create_label_id()
        label_id.set_label(u'Mamma')
        label_id.append_catalogue_nr(u'MA-501')
        expected.append_label_id(label_id)

        expected.set_title(u'Another Story')

        artist = expected.create_artist()
        artist.set_name(u'General Belgrano')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Rock')

        expected.append_style(u'New Wave')

        expected.set_url(u'http://www.discogs.com/General-Belgrano-Another-Story/release/2213179')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'Face I')
        track.set_title(u'Another Story')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'Face II')
        track.set_title("War Isn't Gold")
        track.set_length(None)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/General-Belgrano-Another-Story/release/2213179')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_album_with_roman_track_numbers(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'22 Apr 2014')
        release_event.set_country(u'US')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album, Deluxe Edition, Target Edition')

        label_id = expected.create_label_id()
        label_id.set_label(u'Goodbye Records')
        label_id.append_catalogue_nr(u'GLS-0161-02')
        expected.append_label_id(label_id)

        label_id = expected.create_label_id()
        label_id.set_label(u'Glassnote')
        label_id.append_catalogue_nr(u'GLS-0161-02')
        expected.append_label_id(label_id)

        expected.set_title(u'The Bones Of What You Believe')

        artist = expected.create_artist()
        artist.set_name(u'Chvrches')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Pop')

        expected.append_style(u'Indie Pop')
        expected.append_style(u'Synth-pop')

        expected.set_url(u'http://www.discogs.com/Chvrches-The-Bones-Of-What-You-Believe/release/5622231')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'I')
        track.set_title(u'The Mother We Share')
        track.set_length(192)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'II')
        track.set_title(u'We Sink')
        track.set_length(214)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'III')
        track.set_title(u'Gun')
        track.set_length(234)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'IV')
        track.set_title(u'Tether')
        track.set_length(286)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'V')
        track.set_title(u'Lies')
        track.set_length(221)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'VI')
        track.set_title(u'Under The Tide')
        track.set_length(272)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'VII')
        track.set_title(u'Recover')
        track.set_length(226)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'VIII')
        track.set_title(u'Night Sky')
        track.set_length(231)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'IX')
        track.set_title(u'Science/Visions')
        track.set_length(238)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'X')
        track.set_title(u'Lungs')
        track.set_length(183)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'XI')
        track.set_title(u'By The Throat')
        track.set_length(249)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'XII')
        track.set_title(u'You Caught The Light')
        track.set_length(337)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'XIII')
        track.set_title(u'Recover (Alucard Session)')
        track.set_length(252)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'XIV')
        track.set_title(u'The Mother We Share (Alucard Session)')
        track.set_length(198)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'XV')
        track.set_title(u'Gun (Alucard Session)')
        track.set_length(265)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'XVI')
        track.set_title(u'Tightrope')
        track.set_length(209)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Chvrches-The-Bones-Of-What-You-Believe/release/5622231')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_featuring_track_artist_in_artist_column(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2014')
        release_event.set_country(u'Portugal')
        expected.append_release_event(release_event)

        expected.set_format(u'3 \xd7 CD, Compilation')

        label_id = expected.create_label_id()
        label_id.set_label(u'Vidisco')
        label_id.append_catalogue_nr(u'11.80.9534')
        expected.append_label_id(label_id)

        expected.set_title(u'Caribe Grande \xcaxitos 2014')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Latin')
        expected.append_genre(u'Pop')
        expected.append_genre(u'Folk')
        expected.append_genre(u'World')
        expected.append_genre(u'Country')

        expected.append_style(u'African')
        expected.append_style(u'Electro House')
        expected.append_style(u'Forr\xf3')
        expected.append_style(u'Latin')
        expected.append_style(u'House')

        expected.set_url(u'http://www.discogs.com/Various-Caribe-Grande-%C3%8Axitos-2014/release/5586877')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Show Das Poderosas')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Kelly Pink')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u"Me Agarra So' No Uhm")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Landrick')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Mi Ni\xf1a')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pedro Amorim')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'David Miks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Menina Loka')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jey V')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Y2K')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Meu Eu Em Vo\xe7\xea')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tayla Riddel')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'N\xe3o P\xe1ra (Ela S\xf3 Quer Dan\xe7ar)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u"Johne D'luka")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Bam Bam Bam')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Rogerinho')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Vem A Mi')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Bheaven')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Pecado')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Irm\xe3os Verdades')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'We Gonna Party')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pedro Amorim')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Daduh King')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Gao Percussion')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Ela \xc9 Top')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mc Bola')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mc Rodriguez')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Love Love')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'David Miks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u"R'Bros")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Vamos Zuar')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bryan Wilson')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sebastian Crayn')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mc Bola')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Bailando Asi')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ BodySoul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Hugo Bessa')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jay Laroye')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Stape')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Quem \xc9 Essa Mulher')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Valdemiro Jos\xe9')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Matias Dam\xe1sio')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Ensa\xf1ame (Conexi\xf3n)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Carlitos Rossy')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pipe Calderon')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'El Cata')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Nova La Amenaza')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'M\xe1s')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'Hoje N\xe3o Saio Daqui (Oh Tcha Tcharara)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'3 Beatz Muzik')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title(u'Bailando')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mike Moonnight')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mark F')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Vic J')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Alex B')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'19')
        track.set_title(u'Noche De Fiesta')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jose Delgado')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'David Miks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'20')
        track.set_title(u'Beijo Bom')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Hallux')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Marcus')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Lilian Raquel')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'21')
        track.set_title(u'Mexe Assim')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Bodysoul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'22')
        track.set_title(u'Malandro')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jey V')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'NGA')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Trair A Minha Namorada (Hoje Eu Quero Trair) (DJ Bruno F Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Ricardo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Bruno F')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Quem Bate')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u"R'Bros")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Taty Agressivo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Bango')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jay Lima')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Otro Dia (Mastkisoul Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Gregor Salto')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Kit (Kuenta / Tambu)')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mastiksoul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Mina Loca')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bodytalk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Tiago')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pm Akordeon')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Thiago Martins')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'I Found You (The Spacemakers Dirty Radio Edit)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bryan Wilson')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sebastian Crayn')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Quero Bail\xe1 (Mastik Jay Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jey V')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ademar')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Morena (Massivedrum Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Franklin Rodriques')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'William')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Massivedrum')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Stronger (DJ Bruno F Radio Edit)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Da Fonseca')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jay Lion')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Daniela Pimenta')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bruno Soares Sax')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Bruno F')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Xibita (DJ Mike C Radio Edit)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Meith')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Y.a.m.a')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mc Guy H.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Mike C')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Africanism')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Alvaro Corz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'M\xfasica')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bryan Dalton')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Te Voy Amar (Soul Beatz Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Pedrito')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mike Moonnight')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Vic J')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Players')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Brian Chundro')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Santos')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Marlldexx')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Vem Rebolando')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'James Noyer')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Vale A Pena 2k14')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'D-Rashid')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Praia Del Sol')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'Dan\xe7a Do Tchira')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mika G')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title(u'Bagulho')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Mike C')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'19')
        track.set_title(u'Nrg')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Glowinthedark')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Chuckie')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(3)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Mila')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Banda Mar Azul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Canto Da Cidade')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Banda Mar Azul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Beleza Rara')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Banda Mar Azul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Chorando Se Foi')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bahia Tropical')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Amor Perfeito')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ax\xe9 Bahia')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Ranpuzel')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Banda Mar Azul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Sorte Grande')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bahia Pagode Tropical')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Saia E Bicicletinha')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Banda Ka\xe7amba')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'T\xf4 Nem A\xed')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Daniela')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Sozinho "Dance "')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Banda Mar Azul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        # TODO: decide how to handle this weird Discogs track numbering corner case

        # track = disc.create_track()
        # track.set_number(u'11')
        # track.set_title(u'Pout-Pourri 1')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'12')
        # track.set_title(u'Pout-Pourri 2')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'13')
        # track.set_title(u'Pout-Pourri 3 (Marchas)')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'14')
        # track.set_title(u'Pout-Pourri 4')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'15')
        # track.set_title(u'Pout-Pourri 5')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'16')
        # track.set_title(u'Los Mayos- Disco Samba')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'17')
        # track.set_title(u'Pout-porri 6')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)
        #
        # track = disc.create_track()
        # track.set_number(u'18')
        # track.set_title(u'Pout-porri 7')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'19')
        track.set_title(u'Marcha Do Cord\xe3o Do Bola Preta')
        track.set_length(None)
        disc.append_track(track)

        # track = disc.create_track()
        # track.set_number(u'20')
        # track.set_title(u'Pout-porri 8')
        # track.set_length(None)
        # track_artist = expected.create_artist()
        # track_artist.set_name(u'Unknown Artist')
        # track_artist.set_various(False)
        # track_artist.append_type(expected.ArtistTypes.MAIN)
        # track.append_artist(track_artist)
        # disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Various-Caribe-Grande-%C3%8Axitos-2014/release/5586877')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_featuring_in_artist_and_track_column(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'20 Nov 1996')
        release_event.set_country(u'Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'2 \xd7 CD, Compilation')

        label_id = expected.create_label_id()
        label_id.set_label(u'Sony Music Media')
        label_id.append_catalogue_nr(u'SMM 486760 2')
        expected.append_label_id(label_id)

        label_id = expected.create_label_id()
        label_id.set_label(u'Sony Music Media')
        label_id.append_catalogue_nr(u'486760 2')
        expected.append_label_id(label_id)

        expected.set_title(u'Dream Dance Vol. 3')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')

        expected.append_style(u'Trance')

        expected.set_url(u'http://www.discogs.com/Various-Dream-Dance-Vol-3/release/135664')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Salva Mea (Radio Edit)')
        track.set_length(224)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Faithless')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'A Neverending Dream (Dream Dance Anthem Mix)')
        track.set_length(221)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Trance X')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'7 Seconds (Radio-Video-Single)')
        track.set_length(248)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Nomansland')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'One And One (Space Edit)')
        track.set_length(218)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ronald Snypes')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Sweet Memories (Radio Edit)')
        track.set_length(234)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Groove Solution')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Fall Down On Me (Zhi-Vago In Mission Radio Edit)')
        track.set_length(245)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Solid')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zhi-Vago')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Cybertrance')
        track.set_length(252)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Blue Alphabet')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Beautiful Place (Airwaves Mix)')
        track.set_length(204)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Paul van Dyk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Floating (7\u2033-Mix)')
        track.set_length(249)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Terra Ferma')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'The Nighttrain (Dream Station Remix)')
        track.set_length(369)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Kadoc')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Silencer I (Extended Mix)')
        track.set_length(336)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ The Crow')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title("Insomniak: I'll Be Your Nightmare (Industrial Mix)")
        track.set_length(341)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Grooveman')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Masterpiece')
        track.set_length(238)
        track_artist = expected.create_artist()
        track_artist.set_name(u'P-Casso')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'My Dimension (Radio Edit)')
        track.set_length(205)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Panda')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Secret World (Radio Mix)')
        track.set_length(222)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Vector Mode')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Secret Love (Single Edit)')
        track.set_length(234)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Magnetic Pulstar')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'Atlanta (Sunshine State Club Extravaganza)')
        track.set_length(402)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sunshine State')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Snake Davis')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title("Walk On By (JPO's & Beam's Radio Mix)")
        track.set_length(236)
        track_artist = expected.create_artist()
        track_artist.set_name(u'M.R.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'JPO & Beam')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Up To No Good (Radio Edit)')
        track.set_length(210)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Porn Kings')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Reality (Too Short Video Radio)')
        track.set_length(231)
        track_artist = expected.create_artist()
        track_artist.set_name(u'RMB')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Da Beat Goes\u2026 (Radio Mix)')
        track.set_length(228)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Red 5')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title("Why Don't You Dance With Me (Phuture Mix)")
        track.set_length(204)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Futura Nostra')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Love And Fate (Part 2)')
        track.set_length(296)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Love And Fate')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Go (Woodtick Mix)')
        track.set_length(323)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Moby')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Waters (Phase 2)')
        track.set_length(320)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Taucher')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Do You See The Light (Dance 2 Trance Mix)')
        track.set_length(481)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Snap!')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dance 2 Trance')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Right In The Night (Fall In Love With Music) (Microbots Remix)')
        track.set_length(383)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jam & Spoon')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Plavka')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Microbots')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Te Quierro (Trance Mix)')
        track.set_length(331)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Intrance Feat. D-Sign')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Hablando (Acordeon Mix)')
        track.set_length(391)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ramirez')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pizarro')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Outsiders (Marusha 7\u2033 Edit)')
        track.set_length(240)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Yves Deruyter')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Marusha')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'The Wildlife')
        track.set_length(217)
        track_artist = expected.create_artist()
        track_artist.set_name("Mijk's Magic Marble Box")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Rock Your Body (Radio Mix)')
        track.set_length(221)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The M. Experience III')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title("It's A Dream Song")
        track.set_length(228)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Hooligan')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Rhapsody In E')
        track.set_length(363)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Scooter')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Various-Dream-Dance-Vol-3/release/135664')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_special_track_row_class(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'1999')
        release_event.set_country(u'UK')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Album')

        label_id = expected.create_label_id()
        label_id.set_label(u'Red Wharf')
        label_id.append_catalogue_nr(u'RWCD004')
        expected.append_label_id(label_id)

        expected.set_title(u'Pilgrim')

        artist = expected.create_artist()
        artist.set_name(u'Graham Bowers')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Jazz')

        expected.append_style(u'Modern Classical')

        expected.set_url(u'http://www.discogs.com/Graham-Bowers-Pilgrim/release/728845')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1a')
        track.set_title(u'Unconditional')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'1b')
        track.set_title(u'Loss Of Innocence')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'1c')
        track.set_title(u'Mechanistics')
        track.set_length(None)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Graham-Bowers-Pilgrim/release/728845')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_multiple_special_arists_for_same_track(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2000')
        release_event.set_country(u'UK')
        expected.append_release_event(release_event)

        expected.set_format(u'3 \xd7 CD, Mixed')

        label_id = expected.create_label_id()
        label_id.set_label(u'Pure Silk Records')
        label_id.append_catalogue_nr(u'PURESCD3')
        expected.append_label_id(label_id)

        expected.set_title(u'Pure Silk: The Third Dimension')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')

        expected.append_style(u'UK Garage')

        expected.set_url(u'http://www.discogs.com/Various-Pure-Silk-The-Third-Dimension/release/463634')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Sunshine (Wookie Main Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Gabrielle')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Wookie')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Baby Gonna Rock Dis (Original Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Chris Mack')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Nuts')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Girls Like Us')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'B-15 Project')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Crissy D')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Lady G')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Streetlife (Original 12" Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Daryl B')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Mark Yardley')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title("Don't Waste My Time (4 Beat Mix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Wideboys')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Everybody Come On (Stanton Warriors Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Skribble')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Stanton Warriors')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Get Loose')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Double G')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Right Before My Eyes (The Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name("N'n'G")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Neat')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'What Ya Gonna Do')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Artful Dodger')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title("You Don't Know (Marvel & Eli Remix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'702')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Marvel & Eli')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'I Keep')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name("N'n'G")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Spirit Of The Sun (Bump & Flex Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Lenny Fontana')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bump & Flex')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Celebrate Life (Zed Bias Vocal Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Brasstooth')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sean Mitchell')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zed Bias')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title("Baby (You're So Sexy) (Dub)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dem 2')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Glad You Came To Me (Steve Gurley VIP Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'United Grooves Collective')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Steve Gurley')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Find The Path (Sweet Release Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'New Horizons')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'Give Some To Me (Masterplan)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Suiceyed')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title(u'That Sound')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Michael Moog')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Sweeter Than Wine')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dionne Rakeem')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dreem House Productions')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Feel It')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name("London's Unique 3")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Neighbourhood')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zed Bias')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Rumpus')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Madness On The Street')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Richie Boy')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Klasse')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title("Jump 'n' Shout (Dem 2 Mix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Basement Jaxx')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dem 2')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title("Somebody Else's Guy (Stanton Warriors Vocal Mix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jocelyn Brown')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Stanton Warriors')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Let Me Know')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'K.C.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zed Bias')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'For Real')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'M Dubs')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'J.P.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Tingles 2000 (Zed Bias Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Valerie M')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zed Bias')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title("Buddy X '99 (Original Dreem Teem Dub Mix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dreem Teem')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Neneh Cherry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Apparently Nothing (Artful Dodger Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Brand New Heavies')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Artful Dodger')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Sometimes It Snows In April (Dreem House Dub Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Amar')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Ranking')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dreem House Productions')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Down On Me')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Wookie')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Hold Me Tight')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Lewi')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Beautiful (Dreem House Dub Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Groove Control')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dreem House Productions')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Call It Fate')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Richie Dan')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'A Little Bit Of Luck')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Luck & MC Neat')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title(u'I Want You')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Rosie Gaines')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(3)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Down On Me')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Wookie')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Everybody Come On (Stanton Warriors Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'DJ Skribble')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Stanton Warriors')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'I Keep')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name("N'n'G")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Celebrate Life (Zed Bias Vocal Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Brasstooth')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sean Mitchell')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zed Bias')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Sunshine (Wookie Main Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Gabrielle')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Wookie')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Neighbourhood')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Zed Bias')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Rumpus')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Give Some To Me (Masterplan)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Suiceyed')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title("You Don't Know (Marvel & Eli Remix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'702')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Marvel & Eli')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title("Somebody Else's Guy (Stanton Warriors Filthy Silk Dub)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jocelyn Brown')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Stanton Warriors')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Right Before My Eyes (The Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name("N'n'G")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Neat')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Baby Gonna Rock Dis')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Chris Mack')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'MC Nuts')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Girls Like Us')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'B-15 Project')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Crissy D')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Lady G')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title("Jump 'n' Shout (Dem 2 Mix)")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Basement Jaxx')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Dem 2')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Spirit Of The Sun (Bump & Flex Remix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Lenny Fontana')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bump & Flex')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Glad You Came To Me (Steve Gurley VIP Mix)')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'United Grooves Collective')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Steve Gurley')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Call It Fate')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Richie Dan')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Various-Pure-Silk-The-Third-Dimension/release/463634')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_weird_subtracks_in_tracklist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2005')
        release_event.set_country(u'Netherlands')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Compilation')

        label_id = expected.create_label_id()
        label_id.set_label(u'Stubko Entertainment')
        label_id.append_catalogue_nr(u'255034')
        expected.append_label_id(label_id)

        expected.set_title(u'De Beste Liedjes Van Ome Henk')

        artist = expected.create_artist()
        artist.set_name(u'Ome Henk')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre(u'Electronic')
        expected.append_genre(u'Non-Music')
        expected.append_genre(u'Pop')

        expected.append_style(u'Comedy')
        expected.append_style(u'Euro House')
        expected.append_style(u'Parody')

        expected.set_url('http://www.discogs.com/Ome-Henk-De-Beste-Liedjes-Van-Ome-Henk/release/755732')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Het Is Weer Tijd Voor Ome Henk! (Radio Tune)')
        track.set_length(85)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Opblaaskrokodil (Super Extra Mix)')
        track.set_length(148)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Op De Camping')
        track.set_length(213)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Ik Zing Dit Lied Voor Ome Henk!')
        track.set_length(218)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Neem Een Ander In De Maling!')
        track.set_length(198)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Mambo Nr. 6')
        track.set_length(219)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Heftig!')
        track.set_length(225)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Lekker Lekker (Ga Maar Met Me Mee)')
        track.set_length(213)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Samba La Bamba!')
        track.set_length(184)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u"'T Leven Gaat Niet Over Rozen!")
        track.set_length(213)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Sieb van der Kast')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Ome Henk Viert Feest!')
        track.set_length(236)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Sambal Bij?')
        track.set_length(175)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Ik Ben Verkouwe!')
        track.set_length(234)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Sju Tem')
        track.set_length(195)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Kim Holland')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'Ploem Ploem Jenka (Hup Hop Versie Met Trea Dobbs)')
        track.set_length(162)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Trea Dobbs')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Aaai Oehoe Aai')
        track.set_length(191)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'17')
        track.set_title(u'Oranje!! (We Worden Kampioen!) (Radio Mix)')
        track.set_length(223)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'18')
        track.set_title(u'Olee Olee Sinterklaas Is Here To Stay! (Single Versie)')
        track.set_length(236)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'19')
        track.set_title(u'Een Heel Gelukkig Kerstfeest')
        track.set_length(214)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'20')
        track.set_title(u'Opblaaskrokodil 2005 (Bonustrack)')
        track.set_length(147)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ome Henk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = discogs.ReleaseScraper.from_string(u'http://www.discogs.com/Ome-Henk-De-Beste-Liedjes-Van-Ome-Henk/release/755732')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = discogs.ReleaseScraper.from_string('http://www.discogs.com/Various-Gothic-File-14/release/999999999')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = discogs.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)


class MusicbrainzTest(TestCase):

    def test_simple_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2004-09-23')
        release_event.set_country('Germany')
        expected.append_release_event(release_event)

        expected.set_format('CD, Album')

        label_id = expected.create_label_id()
        label_id.set_label('Trisol')
        label_id.append_catalogue_nr('TRI 070 CD')
        expected.append_label_id(label_id)

        expected.set_title('Hast Du mich vermisst? Der schwarze Schmetterling, Teil I')

        artist = expected.create_artist()
        artist.set_name('ASP')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)



        expected.set_url('http://musicbrainz.org/release/e008606b-a1c9-48ab-8011-5dbf8b874f1b')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Intro: In meiner Vorstellung')
        track.set_length(274)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Schwarzer Schmetterling')
        track.set_length(290)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Where Do the Gods Go')
        track.set_length(226)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Dancing')
        track.set_length(345)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'K\xfcss mich')
        track.set_length(311)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Sing Child')
        track.set_length(238)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Teach Me War')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Imbecile Anthem')
        track.set_length(222)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Und wir tanzten (Ungeschickte Liebesbriefe)')
        track.set_length(304)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Blinded')
        track.set_length(444)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Where Do the Gods Go (re-unleashed club edit)')
        track.set_length(279)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/e008606b-a1c9-48ab-8011-5dbf8b874f1b')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_multiple_cds(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2007-05-25')
        release_event.set_country('Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'4\xd7CD, Album + Live')

        label_id = expected.create_label_id()
        label_id.set_label('Trisol')
        label_id.append_catalogue_nr('TRI 303 CD')
        expected.append_label_id(label_id)

        expected.set_title('Once in a Lifetime')

        artist = expected.create_artist()
        artist.set_name('ASP')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name('Chamber')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/79de4a0c-b469-4dfd-b23c-129462b741fb')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Once in a Lifetime, Part 1')
        track.set_length(351)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'A Dead Man\u2019s Song')
        track.set_length(312)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Versuchung')
        track.set_length(345)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Torn')
        track.set_length(304)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Demon Love')
        track.set_length(272)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'The Paperhearted Ghost')
        track.set_length(283)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'A Tale of Real Love')
        track.set_length(316)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Hunger')
        track.set_length(289)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'The Truth About Snow-White')
        track.set_length(240)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'She Wore Shadows')
        track.set_length(276)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Und wir tanzten (Ungeschickte Liebesbriefe)')
        track.set_length(317)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Once in a Lifetime, Part 2 (reprise)')
        track.set_length(164)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'K\xfcss mich')
        track.set_length(384)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Silence - Release')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Solitude')
        track.set_length(220)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Die Ballade von der Erweckung')
        track.set_length(527)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Another Conversation')
        track.set_length(201)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Sing Child')
        track.set_length(449)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Ich will brennen')
        track.set_length(300)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Toscana')
        track.set_length(374)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Ride On')
        track.set_length(222)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Hometown')
        track.set_length(181)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Werben')
        track.set_length(293)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Once in a Lifetime, Part 3 (Finale)')
        track.set_length(608)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(3)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'H\xe4sslich')
        track.set_length(145)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Backstage (All Areas)')
        track.set_length(573)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Paracetamoltr\xe4ume')
        track.set_length(517)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Auszug aus \u201eTremendista\u201c')
        track.set_length(1473)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Ralph M\xfcller')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Campari O')
        track.set_length(159)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(4)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Sicamore Trees (ASP soundcheck out-take)')
        track.set_length(94)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Demon Love')
        track.set_length(275)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'The Truth About Snow-White')
        track.set_length(275)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'She Wore Shadows')
        track.set_length(319)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Sing Child')
        track.set_length(469)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Hometown')
        track.set_length(221)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Hunger')
        track.set_length(274)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Silence - Release')
        track.set_length(208)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'She Moved Through the Fair (ASP soundcheck out-take)')
        track.set_length(120)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/79de4a0c-b469-4dfd-b23c-129462b741fb')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_various_artists_and_track_remixer(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2010')
        release_event.set_country('Germany')
        expected.append_release_event(release_event)

        expected.set_format('CD, Album + Compilation')

        label_id = expected.create_label_id()
        label_id.set_label('Batbeliever Releases')
        label_id.append_catalogue_nr('BAT 065')
        expected.append_label_id(label_id)

        expected.set_title('Gothic File 11')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/9d78a55c-0eee-4b61-b6eb-b69765c37740')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Carrie Satan')
        track.set_length(312)
        track_artist = expected.create_artist()
        track_artist.set_name('Spectra Paris')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Countdown')
        track.set_length(253)
        track_artist = expected.create_artist()
        track_artist.set_name('Absurd Minds')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'M\xe4dchen in Uniform (Faderhead remix)')
        track.set_length(233)
        track_artist = expected.create_artist()
        track_artist.set_name('Nachtmahr')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Faderhead')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Fucking Invective')
        track.set_length(273)
        track_artist = expected.create_artist()
        track_artist.set_name('Noisuf-X')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Loyal to My Hate (Solar Fake remix)')
        track.set_length(264)
        track_artist = expected.create_artist()
        track_artist.set_name(':wumpscut:')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Solar Fake')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Melancholie (382edit)')
        track.set_length(232)
        track_artist = expected.create_artist()
        track_artist.set_name('KiEw')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Gegen die Welt')
        track.set_length(287)
        track_artist = expected.create_artist()
        track_artist.set_name('Mantus')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title("Ready or Not (I'm Coming)")
        track.set_length(202)
        track_artist = expected.create_artist()
        track_artist.set_name('Oomph!')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('What?')
        track.set_length(166)
        track_artist = expected.create_artist()
        track_artist.set_name('Rob Zombie')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Ebenbild (Die Krupps remix)')
        track.set_length(343)
        track_artist = expected.create_artist()
        track_artist.set_name('Megaherz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Die Krupps')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Vergissmeinnicht (live)')
        track.set_length(239)
        track_artist = expected.create_artist()
        track_artist.set_name('Eisbrecher')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Industrypeople')
        track.set_length(254)
        track_artist = expected.create_artist()
        track_artist.set_name('Zeromancer')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Kick the Bass')
        track.set_length(222)
        track_artist = expected.create_artist()
        track_artist.set_name('Julien-K')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Black Hole')
        track.set_length(325)
        track_artist = expected.create_artist()
        track_artist.set_name('Nosferatu')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Swimming in Dirty Water')
        track.set_length(264)
        track_artist = expected.create_artist()
        track_artist.set_name('Die Art')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Wreckhouse Stomp')
        track.set_length(184)
        track_artist = expected.create_artist()
        track_artist.set_name('Mad Sin')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/9d78a55c-0eee-4b61-b6eb-b69765c37740')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_disc_titles(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2008')
        release_event.set_country('Europe')
        expected.append_release_event(release_event)

        expected.set_format(u'5\xd7CD, Album + Compilation')

        label_id = expected.create_label_id()
        label_id.set_label('Epic')
        label_id.append_catalogue_nr('88697304842')
        expected.append_label_id(label_id)

        expected.set_title('Original Album Classics')

        artist = expected.create_artist()
        artist.set_name('The Isley Brothers')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/12c94a0f-828f-4ab3-8e0d-dfe4599dc310')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title('The Brothers: Isley')

        track = disc.create_track()
        track.set_number('1')
        track.set_title('I Turned You On')
        track.set_length(158)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Vacuum Cleaner')
        track.set_length(176)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('I Got to Get Myself Together')
        track.set_length(218)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Was It Good to You?')
        track.set_length(164)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('The Blacker the Berry (a.k.a. Black Berries)')
        track.set_length(353)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('My Little Girl')
        track.set_length(221)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Get Down Off of the Train')
        track.set_length(192)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Holding On')
        track.set_length(156)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Feels Like the World')
        track.set_length(206)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title('Get Into Something')

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Get Into Something')
        track.set_length(450)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Freedom')
        track.set_length(218)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Take Inventory')
        track.set_length(167)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title("Keep on Doin'")
        track.set_length(242)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Girls Will Be Girls')
        track.set_length(171)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('I Need You So')
        track.set_length(265)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('If He Can You Can')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('I Got to Find Me One')
        track.set_length(278)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Beautiful')
        track.set_length(186)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Bless Your Heart')
        track.set_length(183)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(3)
        disc.set_title("Givin' It Back")

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Ohio - Machine Gun')
        track.set_length(554)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Fire and Rain')
        track.set_length(329)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Lay Lady Lay')
        track.set_length(622)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Spill the Wine')
        track.set_length(392)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Nothing to Do But Today')
        track.set_length(219)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Cold Bologna')
        track.set_length(179)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title("Love the One You're With")
        track.set_length(219)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(4)
        disc.set_title('Brother, Brother, Brother')

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Brother, Brother')
        track.set_length(197)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Put A Little Love In Your Heart')
        track.set_length(182)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title("Sweet Season / Keep On Walkin'")
        track.set_length(313)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Work To Do')
        track.set_length(192)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Pop That Thang')
        track.set_length(174)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Lay Away')
        track.set_length(203)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title("It's Too Late")
        track.set_length(631)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Love Put Me On The Corner')
        track.set_length(390)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(5)
        disc.set_title('3 + 3')

        track = disc.create_track()
        track.set_number('1')
        track.set_title('That Lady, Parts 1 & 2')
        track.set_length(335)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title("Don't Let Me Be Lonely Tonight")
        track.set_length(239)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('If You Were There')
        track.set_length(203)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('You Walk Your Way')
        track.set_length(186)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Listen to the Music')
        track.set_length(246)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('What It Comes Down To')
        track.set_length(234)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Sunshine (Go Away Today)')
        track.set_length(262)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Summer Breeze')
        track.set_length(372)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('The Highways of My Life')
        track.set_length(293)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('That Lady (live)')
        track.set_length(222)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/12c94a0f-828f-4ab3-8e0d-dfe4599dc310')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_special_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2012-11-16')
        release_event.set_country('Germany')
        expected.append_release_event(release_event)

        expected.set_format(u'2\xd7CD, EP')

        label_id = expected.create_label_id()
        label_id.set_label('Trisol')
        label_id.append_catalogue_nr('TRI 460 CD')
        expected.append_label_id(label_id)

        expected.set_title('Die GeistErfahrer EP: Fremder-Zyklus, Teil 1.1')

        artist = expected.create_artist()
        artist.set_name('ASP')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/fc6ee7a8-c70a-4c8f-ab42-43a457a0731f')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'GeistErfahrer')
        track.set_length(360)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'In Sack und Asche')
        track.set_length(440)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'\xdcberH\xe4rte')
        track.set_length(376)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Carpe noctem')
        track.set_length(312)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Weichen(t)stellung (GeistErfahrer Reprise)')
        track.set_length(274)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Danach')
        track.set_length(516)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Sing Child')
        track.set_length(404)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'Duett (Minnelied der Incubi)')
        track.set_length(251)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Krabat')
        track.set_length(358)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Unverwandt')
        track.set_length(667)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Werben')
        track.set_length(440)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/fc6ee7a8-c70a-4c8f-ab42-43a457a0731f')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_release_group(self):
        expected = ListResult()
        expected.set_scraper_name(None)

        item = expected.create_item()
        item.set_name(u'ASP & Chamber \u2013 Humility')
        item.set_info(u'CD | Tracks: 8 | Date: 2006-04-21 | Country: DE | Barcode: 4260063942730')
        item.set_query('https://musicbrainz.org/release/58bad121-bfab-4dda-89f8-4b1bc092de44')
        item.set_url('https://musicbrainz.org/release/58bad121-bfab-4dda-89f8-4b1bc092de44')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'ASP & Chamber \u2013 Humility: Die verschollenen Archive 2')
        item.set_info(u'CD | Tracks: 7 | Date: 2012-03-09 | Country: DE | Barcode: 4260063944505')
        item.set_query('https://musicbrainz.org/release/c2834b8b-77c4-4505-9b55-a31208eb98c3')
        item.set_url('https://musicbrainz.org/release/c2834b8b-77c4-4505-9b55-a31208eb98c3')
        expected.append_item(item)

        s = musicbrainz.ReleaseGroupScraper.from_string('http://musicbrainz.org/release-group/9c8ec90f-dcef-3fc7-904d-27f535454e44')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_vinyl_not_cd_in_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2004-02-24')
        release_event.set_country('United States')
        expected.append_release_event(release_event)

        expected.set_format('12" Vinyl, Album')

        label_id = expected.create_label_id()
        label_id.set_label('Sundazed Music')
        label_id.append_catalogue_nr('LP 5103')
        expected.append_label_id(label_id)

        expected.set_title('Four Sail')

        artist = expected.create_artist()
        artist.set_name('Love')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/bdb4ba37-bb4b-3d2a-bd58-c109dc4d72f0')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('A1')
        track.set_title('August')
        track.set_length(300)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('A2')
        track.set_title("Your Friend and Mine - Neil's Song")
        track.set_length(220)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('A3')
        track.set_title("I'm With You")
        track.set_length(165)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('A4')
        track.set_title('Good Times')
        track.set_length(210)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('A5')
        track.set_title('Singing Cowboy')
        track.set_length(270)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('B1')
        track.set_title('Dream')
        track.set_length(169)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('B2')
        track.set_title('Robert Montgomery')
        track.set_length(214)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('B3')
        track.set_title('Nothing')
        track.set_length(284)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('B4')
        track.set_title('Talking in My Sleep')
        track.set_length(170)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('B5')
        track.set_title('Always See Your Face')
        track.set_length(210)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/bdb4ba37-bb4b-3d2a-bd58-c109dc4d72f0')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_medium_in_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        expected.set_format('Album')

        expected.set_title('Welcome to the Dopehouse')

        artist = expected.create_artist()
        artist.set_name('The Dayton Family')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/0e3b3c85-61b6-4a07-852b-26f7e8dd0ade')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Intro')
        track.set_length(93)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Big Mac 11')
        track.set_length(276)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Do You Remember?')
        track.set_length(200)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Welcome to Flint')
        track.set_length(228)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Feds')
        track.set_length(237)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Gangstarism')
        track.set_length(251)
        track_artist = expected.create_artist()
        track_artist.set_name('Goldfish')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Young Thugs')
        track.set_length(241)
        track_artist = expected.create_artist()
        track_artist.set_name('Ghetto E')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Lori')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Drugstore')
        track.set_length(207)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Set Up')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('We Keep It Ghetto')
        track.set_length(200)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Dope House')
        track.set_length(231)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Shadows')
        track.set_length(242)
        track_artist = expected.create_artist()
        track_artist.set_name('Kalonda & Ryan')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Outlaws')
        track.set_length(226)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Weed Song')
        track.set_length(228)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Simple Wish')
        track.set_length(206)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Outro')
        track.set_length(96)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/0e3b3c85-61b6-4a07-852b-26f7e8dd0ade')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_digital_media_in_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2013-04-08')
        release_event.set_country('Sweden')
        expected.append_release_event(release_event)

        expected.set_format('Digital Media, Album')

        expected.set_title(u'J\xe4rnb\xe4rarland')

        artist = expected.create_artist()
        artist.set_name('Stiko Per Larsson')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/d37fc56e-4b9b-4c4c-9e9e-5d6d5a66944c')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'Zombien f\xf6ds')
        track.set_length(167)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'J\xe4rnb\xe4rarland')
        track.set_length(219)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Veteraner')
        track.set_length(197)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'Resande Man')
        track.set_length(192)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Du h\xf6r inte hemma h\xe4r')
        track.set_length(185)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Irrbloss')
        track.set_length(187)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'J\xe4mtlands president')
        track.set_length(218)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Gilla falla')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Inga v\xe4gar')
        track.set_length(259)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'Krus & detaljer')
        track.set_length(241)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'En kosmonauts testamente')
        track.set_length(375)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/d37fc56e-4b9b-4c4c-9e9e-5d6d5a66944c')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_other_in_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('1999')
        release_event.set_country('United States')
        expected.append_release_event(release_event)

        expected.set_format('Other, Album')

        label_id = expected.create_label_id()
        label_id.set_label('Epic')
        expected.append_label_id(label_id)

        expected.set_title('Retro Futuristo')

        artist = expected.create_artist()
        artist.set_name('Jack Herrera')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/020fc291-af3e-45d7-a2f3-212d42fc260b')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'City Lights')
        track.set_length(313)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'What U Feel')
        track.set_length(295)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'Diamond in the Rough')
        track.set_length(297)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'High Off You')
        track.set_length(299)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'Say You Gotta Man')
        track.set_length(262)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'Jack Shuffle (feat. Will.I.Am)')
        track.set_length(240)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'Up Above My Head')
        track.set_length(320)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'Jack Herrera for President')
        track.set_length(272)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'Free to Believe')
        track.set_length(329)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'For You')
        track.set_length(378)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'Silver & Gold (feat. Black Thought)')
        track.set_length(316)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'Revolution (interlude)')
        track.set_length(78)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'Revolution')
        track.set_length(315)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'Be Free')
        track.set_length(341)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'15')
        track.set_title(u'D\xe9ja Vu')
        track.set_length(218)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'16')
        track.set_title(u'Jewel')
        track.set_length(339)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/020fc291-af3e-45d7-a2f3-212d42fc260b')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_dvd_and_cd_in_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2009-01-14')
        release_event.set_country('Japan')
        expected.append_release_event(release_event)

        expected.set_format('CD + DVD-Video, Album + Compilation')

        label_id = expected.create_label_id()
        label_id.set_label(u'MusicRay\u2019n')
        label_id.append_catalogue_nr('SMCL-163')
        expected.append_label_id(label_id)

        label_id = expected.create_label_id()
        label_id.set_label(u'MusicRay\u2019n')
        label_id.append_catalogue_nr('SMCL-164')
        expected.append_label_id(label_id)

        expected.set_title('CODE GEASS COMPLETE BEST')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/f6fe7f52-b0c8-4bd8-af06-68af909e09ca')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'C.C.\u30e2\u30ce\u30ed\u30fc\u30b0 1')
        track.set_length(31)
        track_artist = expected.create_artist()
        track_artist.set_name(u'C.C.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u3086\u304b\u306a')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'COLORS')
        track.set_length(219)
        track_artist = expected.create_artist()
        track_artist.set_name(u'FLOW')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'\u52c7\u4fa0\u9752\u6625\u8b33')
        track.set_length(262)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ALI PROJECT')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'C.C.\u30e2\u30ce\u30ed\u30fc\u30b0 2')
        track.set_length(35)
        track_artist = expected.create_artist()
        track_artist.set_name(u'C.C.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u3086\u304b\u306a')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'\u89e3\u8aad\u4e0d\u80fd')
        track.set_length(186)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u30b8\u30f3')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'\u30e2\u30b6\u30a4\u30af\u30ab\u30b1\u30e9')
        track.set_length(278)
        track_artist = expected.create_artist()
        track_artist.set_name(u'SunSet Swish')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'\u77b3\u30ce\u7ffc')
        track.set_length(212)
        track_artist = expected.create_artist()
        track_artist.set_name(u'access')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'C.C.\u30e2\u30ce\u30ed\u30fc\u30b0 3')
        track.set_length(35)
        track_artist = expected.create_artist()
        track_artist.set_name(u'C.C.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u3086\u304b\u306a')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'O2 \u301c\u30aa\u30fc\u30fb\u30c4\u30fc\u301c')
        track.set_length(238)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ORANGE RANGE')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'\u30b7\u30a2\u30ef\u30bb\u30cd\u30a4\u30ed')
        track.set_length(259)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ORANGE RANGE')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'C.C.\u30e2\u30ce\u30ed\u30fc\u30b0 4')
        track.set_length(32)
        track_artist = expected.create_artist()
        track_artist.set_name(u'C.C.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u3086\u304b\u306a')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'WORLD END')
        track.set_length(229)
        track_artist = expected.create_artist()
        track_artist.set_name(u'FLOW')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'\u308f\u304c\u81c8\u305f\u3057\u60aa\u306e\u83ef')
        track.set_length(273)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ALI PROJECT')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'C.C.\u30e2\u30ce\u30ed\u30fc\u30b0 5')
        track.set_length(46)
        track_artist = expected.create_artist()
        track_artist.set_name(u'C.C.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u3086\u304b\u306a')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number(u'1')
        track.set_title(u'COLORS type1')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'FLOW')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'2')
        track.set_title(u'COLORS type2')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'FLOW')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'3')
        track.set_title(u'\u52c7\u4fa0\u9752\u6625\u8b33')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ALI PROJECT')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'4')
        track.set_title(u'\u89e3\u8aad\u4e0d\u80fd type1')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u30b8\u30f3')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'5')
        track.set_title(u'\u89e3\u8aad\u4e0d\u80fd type2')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'\u30b8\u30f3')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'6')
        track.set_title(u'\u30e2\u30b6\u30a4\u30af\u30ab\u30b1\u30e9 type1')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'SunSet Swish')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'7')
        track.set_title(u'\u30e2\u30b6\u30a4\u30af\u30ab\u30b1\u30e9 type2')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'SunSet Swish')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'8')
        track.set_title(u'\u77b3\u30ce\u7ffc')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'access')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'9')
        track.set_title(u'O2 \u301c\u30aa\u30fc\u30fb\u30c4\u30fc\u301c')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ORANGE RANGE')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'10')
        track.set_title(u'\u30b7\u30a2\u30ef\u30bb\u30cd\u30a4\u30ed')
        track.set_length(96)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ORANGE RANGE')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'11')
        track.set_title(u'WORLD END type1')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'FLOW')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'12')
        track.set_title(u'WORLD END type2')
        track.set_length(93)
        track_artist = expected.create_artist()
        track_artist.set_name(u'FLOW')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'13')
        track.set_title(u'\u308f\u304c\ufa1f\u305f\u3057\u60aa\u306e\u83ef type1')
        track.set_length(96)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ALI PROJECT')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number(u'14')
        track.set_title(u'\u308f\u304c\ufa1f\u305f\u3057\u60aa\u306e\u83ef type2')
        track.set_length(96)
        track_artist = expected.create_artist()
        track_artist.set_name(u'ALI PROJECT')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/f6fe7f52-b0c8-4bd8-af06-68af909e09ca')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_cdr_in_sub_heading(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2013-06-27')
        release_event.set_country('United States')
        expected.append_release_event(release_event)

        expected.set_format('CD-R, Album')

        label_id = expected.create_label_id()
        label_id.set_label('[no label]')
        expected.append_label_id(label_id)

        expected.set_title('Thaw')

        artist = expected.create_artist()
        artist.set_name('Buckethead')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/dd3f9b98-364c-4da0-b4d7-c79f1c20f1e6')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('[untitled]')
        track.set_length(486)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('[untitled]')
        track.set_length(147)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('[untitled]')
        track.set_length(191)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('[untitled]')
        track.set_length(166)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('[untitled]')
        track.set_length(185)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('[untitled]')
        track.set_length(413)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('[untitled]')
        track.set_length(133)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('[untitled]')
        track.set_length(113)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('[untitled]')
        track.set_length(91)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/dd3f9b98-364c-4da0-b4d7-c79f1c20f1e6')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_featuring_release_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2012-03-19')
        release_event.set_country('United Kingdom')
        expected.append_release_event(release_event)

        expected.set_format('CD, Single')

        label_id = expected.create_label_id()
        label_id.set_label('Interscope Records')
        label_id.append_catalogue_nr('0602527974569')
        expected.append_label_id(label_id)

        expected.set_title("Give Me All Your Luvin'")

        artist = expected.create_artist()
        artist.set_name('Madonna')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name('Nicki Minaj')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.FEATURING)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name('M.I.A.')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.FEATURING)
        expected.append_release_artist(artist)

        expected.set_url('http://musicbrainz.org/release/37df7664-0924-4594-8d07-9d48fa47ced0')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title("Give Me All Your Luvin'")
        track.set_length(202)
        track_artist = expected.create_artist()
        track_artist.set_name('Nicki Minaj')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('M.I.A.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title("Give Me All Your Luvin' (Party Rock remix)")
        track.set_length(243)
        track_artist = expected.create_artist()
        track_artist.set_name('LMFAO')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Nicki Minaj')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/37df7664-0924-4594-8d07-9d48fa47ced0')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = musicbrainz.ReleaseScraper.from_string('http://musicbrainz.org/release/12345-abcdefg')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = musicbrainz.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)


class BeatportTest(TestCase):

    def test_remix_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2006-04-19')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('Karatemusik')
        label_id.append_catalogue_nr('KM013')
        expected.append_label_id(label_id)

        expected.set_title('Love Spy / Love Dies')

        artist = expected.create_artist()
        artist.set_name(u'Polygamy Boys')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Electro House')
        expected.append_genre('Tech House')

        expected.set_url('http://www.beatport.com/release/love-spy-love-dies/27944')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title(u'Love Spy / Love Dies [Error Error Remix]')
        track.set_length(447)
        track_artist = expected.create_artist()
        track_artist.set_name('Error Error')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Love Spy / Love Dies')
        track.set_length(427)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Reply 23')
        track.set_length(418)
        disc.append_track(track)

        expected.append_disc(disc)

        s = beatport.ReleaseScraper.from_string('http://www.beatport.com/release/love-spy-love-dies/27944')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_various_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2012-01-05')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('Carlo Cavalli Music Group')
        label_id.append_catalogue_nr('CMG117')
        expected.append_label_id(label_id)

        expected.set_title('DJ Tunes Compilation')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Progressive House')
        expected.append_genre('House')
        expected.append_genre('Deep House')
        expected.append_genre('Tech House')
        expected.append_genre('Minimal')

        expected.set_url('http://www.beatport.com/release/dj-tunes-compilation/851318')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Forever Loved')
        track.set_length(320)
        track_artist = expected.create_artist()
        track_artist.set_name('Sam Be-Kay')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Sweep [Alex Faraci Remix]')
        track.set_length(398)
        track_artist = expected.create_artist()
        track_artist.set_name('Eros Locatelli')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Alex Faraci')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Humo Y Neon [David Ahumada Remix]')
        track.set_length(298)
        track_artist = expected.create_artist()
        track_artist.set_name('Babette Duwez')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Joel Reichert')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('David Ahumada')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Night Melody [Massimo Russo La Guitarra Remix]')
        track.set_length(377)
        track_artist = expected.create_artist()
        track_artist.set_name('Alex Faraci')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Massimo Russo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('30 m')
        track.set_length(393)
        track_artist = expected.create_artist()
        track_artist.set_name('Fingers Clear')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Just Begin')
        track.set_length(429)
        track_artist = expected.create_artist()
        track_artist.set_name('Erion Gjuzi')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Achakkar')
        track.set_length(388)
        track_artist = expected.create_artist()
        track_artist.set_name('Dany Cohiba')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title(u'Raveline [Italianbeat Guys Remix]')
        track.set_length(406)
        track_artist = expected.create_artist()
        track_artist.set_name('Massimo Russo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Italianbeat Guys')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title(u'Grey 2 Fade feat. Babette Duwez [Jurgen Cecconi Mix]')
        track.set_length(653)
        track_artist = expected.create_artist()
        track_artist.set_name('Jurgen Cecconi')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Beethoven Tbs')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Tanzmania')
        track.set_length(420)
        track_artist = expected.create_artist()
        track_artist.set_name('Carlo Cavalli')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = beatport.ReleaseScraper.from_string('http://www.beatport.com/release/dj-tunes-compilation/851318')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_release_with_empty_track_length(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2008-10-13')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('Bedrock Records')
        label_id.append_catalogue_nr('BEDPPF10')
        expected.append_label_id(label_id)

        expected.set_title('Bedrock 10: Past Present Future')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Progressive House')
        expected.append_genre('House')
        expected.append_genre('Breaks')
        expected.append_genre('Techno')
        expected.append_genre('Tech House')

        expected.set_url('http://www.beatport.com/release/bedrock-10-past-present-future/138250')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title(u'Past Present Future (Part 1) [Continuous DJ Mix]')
        track.set_length(4454)
        track_artist = expected.create_artist()
        track_artist.set_name('John Digweed')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Emerald [Seismic Dub]')
        track.set_length(501)
        track_artist = expected.create_artist()
        track_artist.set_name('Bedrock')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Seizmic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Imagine [Estroe Remix]')
        track.set_length(383)
        track_artist = expected.create_artist()
        track_artist.set_name('Fortunato & Montresor')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Estroe')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Dust [Charlie Mayhem Cold Shoulder Dub]')
        track.set_length(540)
        track_artist = expected.create_artist()
        track_artist.set_name('Pole Folder')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('CP')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Charlie May')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title(u'Chutney [Tom Mangan 2008 Remix]')
        track.set_length(483)
        track_artist = expected.create_artist()
        track_artist.set_name('Tom Mangan')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title(u'Rise In [Steve Lawler Powder Powder Remix]')
        track.set_length(712)
        track_artist = expected.create_artist()
        track_artist.set_name('Steve Lawler')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title(u'Santiago [Chab Remix]')
        track.set_length(522)
        track_artist = expected.create_artist()
        track_artist.set_name('Bedrock')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Chab')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title(u'Warung Beach [Jamie Stevens Remix]')
        track.set_length(516)
        track_artist = expected.create_artist()
        track_artist.set_name('John Digweed')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Jamie Stevens')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title(u'Emerald [Seismic Dub]')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Bedrock')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Charlie May')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title(u"Dirtbox [Bruce Aisher's Resurrection Rewind Mix]")
        track.set_length(464)
        track_artist = expected.create_artist()
        track_artist.set_name('Gutterstylz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Bruce Aisher')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title(u'Repercussion [Danny Howells Remix]')
        track.set_length(594)
        track_artist = expected.create_artist()
        track_artist.set_name('Science Dept.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Danny Howells')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title(u"Beautiful Strange [John Digweed & Nick Muir's Even Stranger Remix]")
        track.set_length(439)
        track_artist = expected.create_artist()
        track_artist.set_name('Nick Muir')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('John Digweed')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title(u'Save Me [James Talk Remix]')
        track.set_length(485)
        track_artist = expected.create_artist()
        track_artist.set_name('Guy J')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('James Talk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title(u'Heaven Scent [M.O.D.E. Remix]')
        track.set_length(675)
        track_artist = expected.create_artist()
        track_artist.set_name('Bedrock')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('M.O.D.E.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title(u'Past Present Future (Part 2) [Continuous DJ Mix]')
        track.set_length(4333)
        track_artist = expected.create_artist()
        track_artist.set_name('John Digweed')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title(u'Forge [Tom Middleton Remix]')
        track.set_length(481)
        track_artist = expected.create_artist()
        track_artist.set_name('Bedrock')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Tom Middleton')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title('Empathy')
        track.set_length(478)
        track_artist = expected.create_artist()
        track_artist.set_name('Jim Rivers')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('18')
        track.set_title(u'Pushin Too Hard [Bruce Aisher Remix]')
        track.set_length(460)
        track_artist = expected.create_artist()
        track_artist.set_name('Saints & Sinners')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Bruce Aisher')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('19')
        track.set_title(u'U Get So Give [Paolo Mojo Remix]')
        track.set_length(497)
        track_artist = expected.create_artist()
        track_artist.set_name('Moonface')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Paolo Mojo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('20')
        track.set_title(u'Chilling Moments [Kazell Influx Audio Remix]')
        track.set_length(422)
        track_artist = expected.create_artist()
        track_artist.set_name('Shmuel Flash')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Kazell')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('21')
        track.set_title(u'K10 [Alan Fitzpatrick Remix]')
        track.set_length(512)
        track_artist = expected.create_artist()
        track_artist.set_name('Misstress Barbara')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Alan Fitzpatrick')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('22')
        track.set_title(u'Chutney [Size 9 Reinterpretation]')
        track.set_length(506)
        track_artist = expected.create_artist()
        track_artist.set_name('Tom Mangan')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('WiNK')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('23')
        track.set_title('Stoppage Time')
        track.set_length(636)
        track_artist = expected.create_artist()
        track_artist.set_name('Guy Gerber')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('24')
        track.set_title('Six Hours Later')
        track.set_length(459)
        track_artist = expected.create_artist()
        track_artist.set_name('Bradler')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Dualton')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('25')
        track.set_title(u'All I Know feat. Astrid Suryanto [Jim Rivers Space Disco Remix]')
        track.set_length(476)
        track_artist = expected.create_artist()
        track_artist.set_name('Morgan Page')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Gregory Shiff')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Jim Rivers')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('26')
        track.set_title('Gravitation')
        track.set_length(323)
        track_artist = expected.create_artist()
        track_artist.set_name('Nick Muir')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('27')
        track.set_title(u'Rise In [Steve Lawler Powder Powder Remix (Edit)]')
        track.set_length(298)
        track_artist = expected.create_artist()
        track_artist.set_name('Steve Lawler')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('28')
        track.set_title(u"Santiago [Guy Gerber's Hotrod Dub]")
        track.set_length(512)
        track_artist = expected.create_artist()
        track_artist.set_name('Bedrock')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Guy Gerber')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('29')
        track.set_title('Sensei')
        track.set_length(441)
        track_artist = expected.create_artist()
        track_artist.set_name("Funk D'Void")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Toby Izui')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('30')
        track.set_title('Madhouse')
        track.set_length(649)
        track_artist = expected.create_artist()
        track_artist.set_name('Pindrop')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('31')
        track.set_title(u'Lunar [Late Night Friday Remix]')
        track.set_length(349)
        track_artist = expected.create_artist()
        track_artist.set_name('Guy J')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = beatport.ReleaseScraper.from_string('http://www.beatport.com/release/bedrock-10-past-present-future/138250')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_release_with_various_artists_in_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2013-07-10')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('040 Recordings')
        label_id.append_catalogue_nr('040REC012C')
        expected.append_label_id(label_id)

        expected.set_title('040 Recordings Ibiza 2013 Vol. 1')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Minimal')
        expected.append_genre('Tech House')

        expected.set_url('http://www.beatport.com/release/040-recordings-ibiza-2013-vol-1/1113652')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Japanese Floor')
        track.set_length(422)
        track_artist = expected.create_artist()
        track_artist.set_name('Cudder & Mulder')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Persian')
        track.set_length(379)
        track_artist = expected.create_artist()
        track_artist.set_name('Carlo Ruetz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Me And My Violin')
        track.set_length(483)
        track_artist = expected.create_artist()
        track_artist.set_name('Andree Wischnewski')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Aurra Che')
        track.set_length(432)
        track_artist = expected.create_artist()
        track_artist.set_name('Dompe')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Cuture Club')
        track.set_length(432)
        track_artist = expected.create_artist()
        track_artist.set_name('Debirski')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Yaman!')
        track.set_length(435)
        track_artist = expected.create_artist()
        track_artist.set_name('Robbe Rabone')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Flint Westwood')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title(u'Jazzy Groovie [Thomas Lizzara Remix]')
        track.set_length(409)
        track_artist = expected.create_artist()
        track_artist.set_name('Kanzler & Wischnewski')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Thomas Lizzara')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Alright')
        track.set_length(416)
        track_artist = expected.create_artist()
        track_artist.set_name('Dompe')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title(u'The Sun Ft. Jan Hilde [Heinrich & Heine Remix]')
        track.set_length(372)
        track_artist = expected.create_artist()
        track_artist.set_name('NECRO & Reichmann')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Heinrich & Heine')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.REMIXER)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Libre')
        track.set_length(376)
        track_artist = expected.create_artist()
        track_artist.set_name('Neal Porter')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Closer')
        track.set_length(430)
        track_artist = expected.create_artist()
        track_artist.set_name('Heinrich & Heine')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Society Today')
        track.set_length(343)
        track_artist = expected.create_artist()
        track_artist.set_name('Maurice Deek')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Music For The People')
        track.set_length(428)
        track_artist = expected.create_artist()
        track_artist.set_name('Heinrich & Heine')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Dont Touch My Phone')
        track.set_length(472)
        track_artist = expected.create_artist()
        track_artist.set_name('Eric Kanzler')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Glare')
        track.set_length(399)
        track_artist = expected.create_artist()
        track_artist.set_name('Heinrich & Heine')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title(u'040 Recordings Ibiza 2013 Vol. 1 [Heinrich & Heine In The Mix]')
        track.set_length(4440)
        disc.append_track(track)

        expected.append_disc(disc)

        s = beatport.ReleaseScraper.from_string('http://www.beatport.com/release/040-recordings-ibiza-2013-vol-1/1113652')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = beatport.ReleaseScraper.from_string('http://www.beatport.com/release/blubb/123')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = beatport.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)


class MetalarchivesTest(TestCase):

    def test_simple_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('June 24th, 2002')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format('Full-length, CD')

        label_id = expected.create_label_id()
        label_id.set_label('Spinefarm Records')
        label_id.append_catalogue_nr('spi149CD / 018459-2')
        expected.append_label_id(label_id)

        expected.set_title('Century Child')

        artist = expected.create_artist()
        artist.set_name('Nightwish')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://www.metal-archives.com/albums/Nightwish/Century_Child/3719')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Bless the Child')
        track.set_length(372)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('End of All Hope')
        track.set_length(235)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Dead to the World')
        track.set_length(260)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Ever Dream')
        track.set_length(284)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Slaying the Dreamer')
        track.set_length(272)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Forever Yours')
        track.set_length(230)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Ocean Soul')
        track.set_length(255)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Feel for You')
        track.set_length(235)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('The Phantom of the Opera')
        track.set_length(250)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Beauty of the Beast')
        track.set_length(622)
        disc.append_track(track)

        expected.append_disc(disc)

        s = metalarchives.ReleaseScraper.from_string('http://www.metal-archives.com/albums/Nightwish/Century_Child/3719')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_multiple_cds(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('September 22nd, 2008')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(u'Live album, 2CD')

        label_id = expected.create_label_id()
        label_id.set_label('GUN Records')
        label_id.append_catalogue_nr('88697 342672')
        expected.append_label_id(label_id)

        expected.set_title('Black Symphony')

        artist = expected.create_artist()
        artist.set_name('Within Temptation')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://www.metal-archives.com/albums/Within_Temptation/Black_Symphony/212779')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Ouverture')
        track.set_length(463)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title("Jillian (I'd Give My Heart)")
        track.set_length(279)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('The Howling')
        track.set_length(391)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Stand My Ground')
        track.set_length(273)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('The Cross')
        track.set_length(322)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('What Have You Done?')
        track.set_length(298)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Hand of Sorrow')
        track.set_length(340)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('The Heart of Everything')
        track.set_length(348)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Forgiven')
        track.set_length(293)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Somewhere')
        track.set_length(264)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('The Swan Song')
        track.set_length(240)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Memories')
        track.set_length(243)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Our Solemn Hour')
        track.set_length(322)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('The Other Half (of Me)')
        track.set_length(304)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Frozen')
        track.set_length(360)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('The Promise')
        track.set_length(272)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Angels')
        track.set_length(495)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Mother Earth')
        track.set_length(242)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('The Truth Beneath the Rose')
        track.set_length(443)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Deceiver of Fools')
        track.set_length(458)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('All I Need')
        track.set_length(295)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Ice Queen')
        track.set_length(435)
        disc.append_track(track)

        expected.append_disc(disc)

        s = metalarchives.ReleaseScraper.from_string('http://www.metal-archives.com/albums/Within_Temptation/Black_Symphony/212779')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_multiple_release_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('April 14th, 2007')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format('Split, 7" vinyl (45 RPM)')

        label_id = expected.create_label_id()
        label_id.set_label('New Iron Age Records')
        label_id.append_catalogue_nr('NIA 002')
        expected.append_label_id(label_id)

        expected.set_title('Clash of Iron Vol. I - Live at Keep It True')

        artist = expected.create_artist()
        artist.set_name('Manilla Road')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name('Brocas Helm')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://www.metal-archives.com/albums/Manilla_Road/Clash_of_Iron_Vol._I_-_Live_at_Keep_It_True/147439')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Manilla Road - Death by the Hammer')
        track.set_length(None)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Brocas Helm - Ravenwreck')
        track.set_length(None)
        disc.append_track(track)

        expected.append_disc(disc)

        s = metalarchives.ReleaseScraper.from_string('http://www.metal-archives.com/albums/Manilla_Road/Clash_of_Iron_Vol._I_-_Live_at_Keep_It_True/147439')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = metalarchives.ReleaseScraper.from_string('http://www.metal-archives.com/albums/Within_Temptation/Black_Symphony/999999999')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = metalarchives.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)


class JunodownloadTest(TestCase):

    def test_simple_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('3 July, 2011')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('3 Beat')
        label_id.append_catalogue_nr('3BEAT 051')
        expected.append_label_id(label_id)

        expected.set_title('Love')

        artist = expected.create_artist()
        artist.set_name('Inna')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Funky')
        expected.append_genre('Club House')

        expected.set_url('http://www.junodownload.com/products/love/1774811-02/')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Love (UK radio edit)')
        track.set_length(151)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Love (club mix)')
        track.set_length(299)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Love (eSquire radio edit)')
        track.set_length(233)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Love (eSquire mix)')
        track.set_length(357)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Love (7th Heaven radio edit)')
        track.set_length(230)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Love (7th Heaven mix)')
        track.set_length(394)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Love (Dandeej mix)')
        track.set_length(315)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Love (DJ Andi mix)')
        track.set_length(341)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Love (Klubfiller mix)')
        track.set_length(395)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Love (Klubfiller dub mix)')
        track.set_length(389)
        disc.append_track(track)

        expected.append_disc(disc)

        s = junodownload.ReleaseScraper.from_string('http://www.junodownload.com/products/love/1774811-02/')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_featuring_main_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('12 November, 2010')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('Staff Productions')
        label_id.append_catalogue_nr('SFP 012')
        expected.append_label_id(label_id)

        expected.set_title('Love')

        artist = expected.create_artist()
        artist.set_name('Mustafa')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name('Tasita D mour')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.FEATURING)
        expected.append_release_artist(artist)

        expected.append_genre('Broken Beat')
        expected.append_genre('Nu Jazz')

        expected.set_url('http://www.junodownload.com/products/love/1662955-02/')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Love (original Miami mix)')
        track.set_length(301)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title("Love (Mustafa's Deep Piano mix)")
        track.set_length(308)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Love (D-Malice Afro-edit vocal)')
        track.set_length(381)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Love (RY meets Mustafa vocal mix)')
        track.set_length(365)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Love (Ospina & Oscar P remix)')
        track.set_length(365)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Love (Ospina & Oscar P Drum dub)')
        track.set_length(365)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Love (Steven Stone remix)')
        track.set_length(389)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Love (David Mateo & Rafix club mix)')
        track.set_length(297)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Love (Rafael Yapudjian Meets RyB remix)')
        track.set_length(449)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Love (acoustic mix)')
        track.set_length(232)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Love (D-Malice Afro edit instrumental)')
        track.set_length(381)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Love (Ospina & Oscar P intru-mental)')
        track.set_length(365)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Love (Steven Stone instrumental remix)')
        track.set_length(388)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Love (David Mateo & Rafix radio club mix instrumental)')
        track.set_length(297)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Love (Rafael Yapudjian Meets RyB dub remix)')
        track.set_length(449)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Love (RY Meets Mustafa instrumental mix)')
        track.set_length(365)
        disc.append_track(track)

        expected.append_disc(disc)

        s = junodownload.ReleaseScraper.from_string('http://www.junodownload.com/products/love/1662955-02/')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_mixed_various_main_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('25 July, 2011')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('Vacation Australia')
        label_id.append_catalogue_nr('VRCD 003')
        expected.append_label_id(label_id)

        expected.set_title('Bass Kleph Presents')

        artist = expected.create_artist()
        artist.set_name('Bass Kleph')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Funky')
        expected.append_genre('Club House')

        expected.set_url('http://www.junodownload.com/products/bass-kleph-bass-kleph-presents/1789514-02/')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Bass Kleph & Filthy Rich - These Mornings')
        track.set_length(368)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Bass Kleph & Alex Kenji - Melocoton')
        track.set_length(370)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Bass Kleph - Hey Ya')
        track.set_length(380)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Bass Kleph & Chris Arnott & BKCA - We Feel Love')
        track.set_length(360)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Bass Kleph - Oh Yeah')
        track.set_length(403)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Stella MC & Bass Kleph - $pend My Money (original club mix)')
        track.set_length(490)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title("Bass Kleph - I'll Be OK")
        track.set_length(434)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Danny T & Oh Snap!! - Whine Ya Waistline (Bass Kleph remix)')
        track.set_length(404)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Joan Reyes - Shakedown (Bass Kleph remix)')
        track.set_length(438)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Bass Kleph & Prok & Fitch - Disco Ate My Baby')
        track.set_length(362)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Moguai & Westbam - Original Hardcore (Bass Kleph remix)')
        track.set_length(420)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Jesse Vorn - Somewhere (Bass Kleph remix)')
        track.set_length(376)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Bass Kleph & Chris Arnott & Kid Massive - All Right (Bass Kleph remix)')
        track.set_length(456)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Bass Kleph & Joan Reyes - Salida (original club mix)')
        track.set_length(427)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Bass Kleph & D Ramirez - Pulse')
        track.set_length(396)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Various - Bass Kleph Presents (continuous DJ mix by Bass Kleph)')
        track.set_length(4439)
        disc.append_track(track)

        expected.append_disc(disc)

        s = junodownload.ReleaseScraper.from_string('http://www.junodownload.com/products/bass-kleph-bass-kleph-presents/1789514-02/')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_various_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('30 December, 2008')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        label_id = expected.create_label_id()
        label_id.set_label('NuZone Tools')
        label_id.append_catalogue_nr('NZT 015')
        expected.append_label_id(label_id)

        expected.set_title('2008 MOST USEFUL TOOLS')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Progressive House')

        expected.set_url('http://www.junodownload.com/products/2008-most-useful-tools/1384246-02/')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Sygma - Nightlights')
        track.set_length(522)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title("Adolfo Morrone - I'm Nervhouse")
        track.set_length(455)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Jonathan Carey - The Science Of Music')
        track.set_length(354)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Lorenzo Venturini - New Era')
        track.set_length(415)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('E-Mark - Anthem For Deejays Part 2')
        track.set_length(420)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Alex Spadoni - Sunset')
        track.set_length(451)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Jordan Baxxter feat Aedo - What It Feels Like For A Girl?')
        track.set_length(470)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Hildebrand - Raindrops')
        track.set_length(519)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Dario Maffia - Phaelon')
        track.set_length(545)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Emerald Coast - Exhausted')
        track.set_length(338)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Sygma - Children')
        track.set_length(539)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('GoldSaint - Tonight')
        track.set_length(405)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Peter Santos - Back To You')
        track.set_length(454)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Oscar Burnside - Dark Side')
        track.set_length(334)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('GoldSaint - Recharge')
        track.set_length(510)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Luca Lux - Wildest Dream')
        track.set_length(428)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title('SimoX DJ - Star')
        track.set_length(317)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('18')
        track.set_title('Greek S - The Sound (09 mix)')
        track.set_length(517)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('19')
        track.set_title('Various - Mixed Tools 2008 (Part 1 - mixed by Sygma)')
        track.set_length(2494)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('20')
        track.set_title('Various - Mixed Tools 2008 (Part 2 - mixed by Peter Santos)')
        track.set_length(2334)
        disc.append_track(track)

        expected.append_disc(disc)

        s = junodownload.ReleaseScraper.from_string('http://www.junodownload.com/products/2008-most-useful-tools/1384246-02/')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = junodownload.ReleaseScraper.from_string('http://www.junodownload.com/products/2008-most-useful-tools/99999999/')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = junodownload.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)


class ITunesTest(TestCase):

    def test_simple_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('1985')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        expected.set_title('Love (Remastered)')

        artist = expected.create_artist()
        artist.set_name('The Cult')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Rock')
        expected.append_genre('Adult Alternative')
        expected.append_genre('Hard Rock')
        expected.append_genre('Alternative')
        expected.append_genre('Goth Rock')
        expected.append_genre('College Rock')

        expected.set_url('http://itunes.apple.com/us/album/love-remastered/id3022929?ign-mpt=uo%3D4')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Nirvana')
        track.set_length(326)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Big Neon Glitter')
        track.set_length(291)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Love')
        track.set_length(329)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Brother Wolf, Sister Moon')
        track.set_length(407)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Rain')
        track.set_length(236)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Phoenix')
        track.set_length(306)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Hollow Man')
        track.set_length(285)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Revolution')
        track.set_length(326)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('She Sells Sanctuary')
        track.set_length(263)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Black Angel')
        track.set_length(322)
        disc.append_track(track)

        expected.append_disc(disc)

        s = itunes.ReleaseScraper.from_string('http://itunes.apple.com/us/album/love-remastered/id3022929?ign-mpt=uo%3D4')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_multiple_cds(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('Aug 15, 2007')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        expected.set_title('Dark Passion Play (Double Disc Version)')

        artist = expected.create_artist()
        artist.set_name('Nightwish')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Rock')
        expected.append_genre('Metal')
        expected.append_genre('Alternative')
        expected.append_genre('Goth Rock')
        expected.append_genre('Death Metal/Black Metal')

        expected.set_url('https://itunes.apple.com/us/album/dark-passion-play-double-disc/id264697038?uo=4')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('The Poet and the Pendulum')
        track.set_length(834)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Bye Bye Beautiful')
        track.set_length(254)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Amaranth')
        track.set_length(231)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Cadence of Her Last Breath')
        track.set_length(254)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Master Passion Greed')
        track.set_length(362)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Eva')
        track.set_length(265)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Sahara')
        track.set_length(347)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Whoever Brings the Night')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('For the Heart I Once Had')
        track.set_length(235)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('The Islander')
        track.set_length(305)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Last of the Wilds')
        track.set_length(340)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('7 Days to the Wolves')
        track.set_length(423)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Meadows of Heaven')
        track.set_length(430)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Reach (Amaranth Demo Version) [Bonus Track]')
        track.set_length(232)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('The Poet and the Pendulum (Instrumental)')
        track.set_length(834)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Bye Bye Beautiful (Instrumental)')
        track.set_length(254)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Amaranth (Instrumental)')
        track.set_length(231)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Cadence of Her Last Breath (Instrumental)')
        track.set_length(254)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Master Passion Greed (Instrumental)')
        track.set_length(362)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Eva (Instrumental)')
        track.set_length(265)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Sahara (Instrumental)')
        track.set_length(347)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Whoever Brings the Night (Instrumental)')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('For the Heart I Once Had (Instrumental)')
        track.set_length(236)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('The Islander (Instrumental)')
        track.set_length(305)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Last of the Wilds (Instrumental)')
        track.set_length(340)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('7 Days to the Wolves (Instrumental)')
        track.set_length(424)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Meadows of Heaven (Instrumental)')
        track.set_length(429)
        disc.append_track(track)

        expected.append_disc(disc)

        s = itunes.ReleaseScraper.from_string('https://itunes.apple.com/us/album/dark-passion-play-double-disc/id264697038?uo=4')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_various_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('Oct 28, 2008')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        expected.set_title('Twilight (Original Motion Picture Soundtrack)')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Soundtrack')

        expected.set_url('https://itunes.apple.com/us/album/twilight-original-motion-picture/id294342468?ign-mpt=uo%3D4')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Supermassive Black Hole')
        track.set_length(209)
        track_artist = expected.create_artist()
        track_artist.set_name('Muse')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Decode')
        track.set_length(261)
        track_artist = expected.create_artist()
        track_artist.set_name('Paramore')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Full Moon')
        track.set_length(230)
        track_artist = expected.create_artist()
        track_artist.set_name('The Black Ghosts')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Leave Out All the Rest')
        track.set_length(199)
        track_artist = expected.create_artist()
        track_artist.set_name('LINKIN PARK')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Spotlight (Twilight Mix)')
        track.set_length(200)
        track_artist = expected.create_artist()
        track_artist.set_name('MuteMath')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Go All the Way (Into the Twilight)')
        track.set_length(207)
        track_artist = expected.create_artist()
        track_artist.set_name('Perry Farrell')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Tremble for My Beloved')
        track.set_length(233)
        track_artist = expected.create_artist()
        track_artist.set_name('Collective Soul')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('I Caught Myself')
        track.set_length(235)
        track_artist = expected.create_artist()
        track_artist.set_name('Paramore')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Eyes On Fire')
        track.set_length(301)
        track_artist = expected.create_artist()
        track_artist.set_name('Blue Foundation')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Never Think')
        track.set_length(269)
        track_artist = expected.create_artist()
        track_artist.set_name('Rob Pattinson')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Flightless Bird, American Mouth')
        track.set_length(240)
        track_artist = expected.create_artist()
        track_artist.set_name('Iron & Wine')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title("Bella's Lullaby")
        track.set_length(138)
        track_artist = expected.create_artist()
        track_artist.set_name('Carter Burwell')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Let Me Sign (Bonus Track)')
        track.set_length(138)
        track_artist = expected.create_artist()
        track_artist.set_name('Rob Pattinson')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('La Traviata (Bonus Track)')
        track.set_length(185)
        track_artist = expected.create_artist()
        track_artist.set_name('Royal Philharmonic Orchestra')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Clair de Lune (Bonus Track)')
        track.set_length(358)
        track_artist = expected.create_artist()
        track_artist.set_name('The APM Orchestra')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = itunes.ReleaseScraper.from_string('https://itunes.apple.com/us/album/twilight-original-motion-picture/id294342468?ign-mpt=uo%3D4')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_non_us_store(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('1985')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        expected.set_title('Love (Remastered)')

        artist = expected.create_artist()
        artist.set_name('The Cult')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Rock')
        expected.append_genre('Musique')
        expected.append_genre('Alternative adulte')
        expected.append_genre('Hard rock')
        expected.append_genre('Alternative')
        expected.append_genre('Rock gothique')
        expected.append_genre('College rock')

        expected.set_url('http://itunes.apple.com/fr/album/love-remastered/id3022929?ign-mpt=uo%3D4')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Nirvana')
        track.set_length(326)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Big Neon Glitter')
        track.set_length(291)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Love')
        track.set_length(329)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Brother Wolf, Sister Moon')
        track.set_length(407)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Rain')
        track.set_length(236)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Phoenix')
        track.set_length(306)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Hollow Man')
        track.set_length(285)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Revolution')
        track.set_length(326)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('She Sells Sanctuary')
        track.set_length(263)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Black Angel')
        track.set_length(322)
        disc.append_track(track)

        expected.append_disc(disc)

        s = itunes.ReleaseScraper.from_string('http://itunes.apple.com/fr/album/love-remastered/id3022929?ign-mpt=uo%3D4')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_tracknum_in_name_column(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('Jun 01, 2005')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format(None)

        expected.set_title('Chopin: Piano Works')

        artist = expected.create_artist()
        artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Classical')

        expected.set_url('https://itunes.apple.com/us/album/chopin-piano-works/id77261376')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('12 Etudes, Op. 10: No. 1. in C')
        track.set_length(136)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('12 Etudes, Op.10: No. 2. in A Minor "chromatique"')
        track.set_length(84)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('12 Etudes, Op.10: No. 3. in E "Tristesse"')
        track.set_length(243)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('12 Etudes, Op.10: No. 4. in C-Sharp Minor')
        track.set_length(128)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('12 Etudes, Op.10: No. 5. in G-Flat "Black Keys"')
        track.set_length(102)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('12 Etudes, Op.10: No. 6. in E-Flat Minor')
        track.set_length(195)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('12 Etudes, Op.10: No. 7. in C')
        track.set_length(92)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('12 Etudes, Op.10: No. 8. in F')
        track.set_length(163)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('12 Etudes, Op.10: No. 9. in F Minor')
        track.set_length(137)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('12 Etudes, Op.10: No. 10. in A-Flat')
        track.set_length(140)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('12 Etudes, Op.10: No. 11. in E-Flat')
        track.set_length(135)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('12 Etudes, Op.10: No. 12. in C Minor "Revolutionary"')
        track.set_length(173)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('12 Etudes, Op. 25: No. 1 in A-Flat - "Harp Study"')
        track.set_length(171)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('12 Etudes, Op.25: No. 2 in F Minor')
        track.set_length(92)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('12 Etudes, Op.25: No. 3 in F Major')
        track.set_length(103)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('12 Etudes, Op.25: No. 4 in A Minor')
        track.set_length(88)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title('12 Etudes, Op.25: No. 5 in E Minor')
        track.set_length(198)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('18')
        track.set_title('12 Etudes, Op.25: No. 6 in G-Sharp Minor')
        track.set_length(117)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('19')
        track.set_title('12 Etudes, Op.25: No. 7 in C-Sharp Minor')
        track.set_length(312)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('20')
        track.set_title('12 Etudes, Op.25: No. 8 in D-Flat')
        track.set_length(66)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('21')
        track.set_title('12 Etudes, Op.25: No. 9 in G-Flat, "Butterfly Wings"')
        track.set_length(62)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('22')
        track.set_title('12 Etudes, Op.25: No. 10 in B Minor')
        track.set_length(244)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('23')
        track.set_title('12 Etudes, Op.25: No. 11 in A Minor "Winter Wind"')
        track.set_length(215)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('24')
        track.set_title('12 Etudes, Op. 25: No. 12 in C Minor')
        track.set_length(168)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('25')
        track.set_title('Impromptu No. 1 in A-Flat, Op.29')
        track.set_length(233)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('26')
        track.set_title('Impromptu No. 2 in F-Sharp, Op.36')
        track.set_length(351)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('27')
        track.set_title('Impromptu No. 3 in G-Flat, Op.51')
        track.set_length(284)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('28')
        track.set_title('Impromptu No. 4 in C-Sharp Minor, Op. 66 "Fantaisie-Impromptu"')
        track.set_length(291)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Piano Sonata No. 2 in B-Flat Minor, Op. 35: I. Grave - Doppio Movimento')
        track.set_length(331)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Piano Sonata No. 2 in B-Flat Minor, Op. 35: II. Scherzo - Pi\xf9 Lento - Tempo I')
        track.set_length(397)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Piano Sonata No. 2 in B-Flat Minor, Op. 35: III. Marche Fun\xe8bre (Lento)')
        track.set_length(503)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Piano Sonata No. 2 in B-Flat Minor, Op. 35: IV. Finale (Presto)')
        track.set_length(97)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Piano Sonata No. 3 in B Minor, Op. 58: I. Allegro Maestoso')
        track.set_length(533)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Piano Sonata No. 3 in B Minor, Op. 58: II. Scherzo (Molto Vivace)')
        track.set_length(170)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Piano Sonata No. 3 in B Minor, Op. 58: III. Largo')
        track.set_length(561)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Piano Sonata No. 3 in B Minor, Op. 58: IV. Finale (Presto Non Tanto)')
        track.set_length(309)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Mazurka No. 54 in D: Allegro Non Troppo')
        track.set_length(71)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Mazurka No. 46 in C Op.67 No.3: Allegretto')
        track.set_length(88)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Mazurka No. 49 in A Minor Op. 68, No. 2: Lento')
        track.set_length(155)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Mazurka No. 5 in B-Flat Op. 7, No. 1: Vivace')
        track.set_length(140)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Introduction and Variations On a German National Air Op.posth. (KK 925-927)')
        track.set_length(387)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Mazurka No. 58 in A-Flat: Poco Mosso')
        track.set_length(77)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Berceuse in D-Flat, Op. 57: Andante')
        track.set_length(316)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Polonaise No. 6 in A-Flat, Op. 53 -"Heroic": Maestoso')
        track.set_length(413)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(3)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Piano Concerto No. 1 in E Minor, Op. 11: I. Allegro Maestoso')
        track.set_length(1215)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jerzy Semkow')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Berlin Philharmonic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Piano Concerto No. 1 in E Minor, Op. 11: II. Romance (Larghetto)')
        track.set_length(636)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jerzy Semkow')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Berlin Philharmonic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Piano Concerto No. 1 in E Minor, Op. 11: III. Rondo (Vivace)')
        track.set_length(619)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jerzy Semkow')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Berlin Philharmonic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Piano Concerto No. 2 in F Minor, Op. 21: I. Maestoso')
        track.set_length(901)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Janos Kulka')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Berlin Philharmonic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Piano Concerto No. 2 in F Minor, Op. 21: II. Larghetto')
        track.set_length(583)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Janos Kulka')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Berlin Philharmonic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Piano Concerto No. 2 in F Minor, Op. 21: III. Allegro Vivace')
        track.set_length(524)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Janos Kulka')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Berlin Philharmonic')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tam\xe1s V\xe1s\xe1ry')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = itunes.ReleaseScraper.from_string('https://itunes.apple.com/us/album/chopin-piano-works/id77261376')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = itunes.ReleaseScraper.from_string('http://itunes.apple.com/us/album/blubb/id999999999999')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_non_us_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = itunes.ReleaseScraper.from_string('http://itunes.apple.com/fr/album/blubb/id999999999999')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = itunes.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)


class BandcampTest(TestCase):

    def test_album_with_band_name(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2012')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format('WEB release')

        expected.set_title(u'Love Sex Machine')

        artist = expected.create_artist()
        artist.set_name(u'Love Sex Machine')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://music.throatruinerrecords.com/album/love-sex-machine')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title(u'Anal On Deceased Virgin')
        track.set_length(335)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Deafening Peepshow')
        track.set_length(270)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Fucking Battle')
        track.set_length(157)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Antagonism Can STFU')
        track.set_length(179)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title(u'Plenty Of Feelings')
        track.set_length(147)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title(u'Vagina Curse')
        track.set_length(320)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title(u'Killed With A Monster Cock')
        track.set_length(284)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title(u'Warstrike Takes The Piss')
        track.set_length(275)
        disc.append_track(track)

        expected.append_disc(disc)

        s = bandcamp.ReleaseScraper.from_string('http://music.throatruinerrecords.com/album/love-sex-machine')
        r = s.get_result()

        self.assertEqual(expected, r)

    # there was a test with this name, but I don't know what it did...
    # def test_album_without_band_name(self):
    #     pass

    def test_album_with_various_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2013')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format('WEB release')

        expected.set_title(u'Indietracks Compilation 2013')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://indietracks.bandcamp.com/album/indietracks-compilation-2013')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title(u'If You Still Want Him')
        track.set_length(250)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The French Defence')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Is Anybody Out There?')
        track.set_length(246)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Ballet')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Rulers And The States')
        track.set_length(165)
        track_artist = expected.create_artist()
        track_artist.set_name(u'bis')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Temporary Tattoo')
        track.set_length(171)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Lardpony')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title(u'Always Want Us To')
        track.set_length(192)
        track_artist = expected.create_artist()
        track_artist.set_name(u'EXPENSIVE')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title(u'Stockport')
        track.set_length(328)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Wake')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title(u'Secret')
        track.set_length(132)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Frozy')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title(u'Jackie')
        track.set_length(218)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Understudies')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title(u'Ticket Machine')
        track.set_length(184)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Making Marks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title(u'Echoing Days')
        track.set_length(204)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Monnone Alone')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title(u'Swanwick Junction')
        track.set_length(172)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Northern Spies')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title(u'Terrible Things')
        track.set_length(141)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Owl & Mouse')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title(u"She'll Come Back for Indian Summer")
        track.set_length(218)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Alpaca Sports')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title(u'Glockelbar')
        track.set_length(137)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Haiku Salut')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title(u'Astronaut')
        track.set_length(190)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Woog Riots')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title(u'Tut Tut Tut')
        track.set_length(150)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Tuts')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title(u'Mosaic')
        track.set_length(161)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Fear Of Men')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('18')
        track.set_title(u'Only You')
        track.set_length(194)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Big Wave')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('19')
        track.set_title(u'The Things That You Said')
        track.set_length(200)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Fireworks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('20')
        track.set_title(u'Glue')
        track.set_length(276)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Fever Dream')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('21')
        track.set_title(u'Slackjawed')
        track.set_length(175)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Tunabunny')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('22')
        track.set_title(u'Lie')
        track.set_length(224)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Cars Can Be Blue')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('23')
        track.set_title(u'Br\xe4nn\xf6')
        track.set_length(223)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Finnmark!')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('24')
        track.set_title(u'Sorry')
        track.set_length(166)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Art Club')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('25')
        track.set_title(u'Food')
        track.set_length(181)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Lovely Eggs')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('26')
        track.set_title(u'Clean Up Yr Own Shit, Pal')
        track.set_length(132)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Good Grief')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('27')
        track.set_title(u'Sycamore')
        track.set_length(162)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Martha')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('28')
        track.set_title(u'Disappear')
        track.set_length(147)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Bloomer')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('29')
        track.set_title(u'You Held My Hand')
        track.set_length(158)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Flowers')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('30')
        track.set_title(u'J.K.')
        track.set_length(139)
        track_artist = expected.create_artist()
        track_artist.set_name(u'David Leach')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('31')
        track.set_title(u'Always Thought')
        track.set_length(294)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Jupiter In Jars')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('32')
        track.set_title(u'My Old Friend')
        track.set_length(164)
        track_artist = expected.create_artist()
        track_artist.set_name(u"Enderby's Room")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('33')
        track.set_title(u'I Got The Answer')
        track.set_length(172)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Magic Theatre')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('34')
        track.set_title(u'I Love You')
        track.set_length(178)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Wave Pictures')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('35')
        track.set_title(u'Pilot Light')
        track.set_length(234)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pete Green')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('36')
        track.set_title(u"Let's Go Surfing")
        track.set_length(181)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Helen Love')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('37')
        track.set_title(u'Summer, You And Me')
        track.set_length(180)
        track_artist = expected.create_artist()
        track_artist.set_name(u'When Nalda Became Punk')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('38')
        track.set_title(u'Secret Wish')
        track.set_length(89)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The McTells')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('39')
        track.set_title(u'Better Than Love')
        track.set_length(163)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Pale Spectres')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('40')
        track.set_title(u'Without You')
        track.set_length(147)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Milky Wimpshake')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('41')
        track.set_title(u"Let's Stay Undecided")
        track.set_length(181)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Soulboy Collective mit Antenne Danger')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('42')
        track.set_title(u'Age Of Victoria')
        track.set_length(261)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Secret History')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('43')
        track.set_title(u'Eating Me, Eating You')
        track.set_length(202)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Beautiful Word')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('44')
        track.set_title(u'Scared And Worried')
        track.set_length(142)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Without Feathers')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('45')
        track.set_title(u'Save Me')
        track.set_length(155)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Choo Choo Trains')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('46')
        track.set_title(u'Evil/Shy (Acoustic Version)')
        track.set_length(187)
        track_artist = expected.create_artist()
        track_artist.set_name(u'The Mini Skips')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('47')
        track.set_title(u'Slow Trains')
        track.set_length(201)
        track_artist = expected.create_artist()
        track_artist.set_name(u'anaesthetics')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = bandcamp.ReleaseScraper.from_string('http://indietracks.bandcamp.com/album/indietracks-compilation-2013')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_album_with_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2012')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format('Free WEB release')

        expected.set_title(u'Love Everyday EP')

        artist = expected.create_artist()
        artist.set_name(u'Dumbfoundead')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://music.dumbfoundead.com/album/love-everyday-ep')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title(u'For You')
        track.set_length(91)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Love Everyday')
        track.set_length(211)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Stole the Show')
        track.set_length(177)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Love is a Song')
        track.set_length(292)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title(u'Body High ft. Breezy Lovejoy & Jose Rios')
        track.set_length(267)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title(u'Not Right Now ft. Wax')
        track.set_length(173)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title(u'Breezy Lovejoy - Paradise')
        track.set_length(202)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Breezy Lovejoy')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = bandcamp.ReleaseScraper.from_string('http://music.dumbfoundead.com/album/love-everyday-ep')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_album_with_utf8_characters(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(u'2012')
        release_event.set_country(None)
        expected.append_release_event(release_event)

        expected.set_format('WEB release')

        expected.set_title(u'Illusions')

        artist = expected.create_artist()
        artist.set_name(u'Approaching Nirvana')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.set_url('http://music.approachingnirvana.com/album/illusions')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title(u'Sugar High')
        track.set_length(162)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title(u'Illusion (feat. Brenton Mattheus)')
        track.set_length(267)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title(u'Beer Remastered')
        track.set_length(281)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Snowfall')
        track.set_length(270)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title(u'Love Theory')
        track.set_length(157)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title(u'Canc\xfan')
        track.set_length(257)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title(u'South Side')
        track.set_length(268)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title(u'Illusion (Instrumental)')
        track.set_length(267)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title(u'Love Theory (Instrumental)')
        track.set_length(157)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title(u'Illusion (Extended Mix) [feat. Brenton Mattheus]')
        track.set_length(372)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title(u'Beer Remastered (Extended Mix)')
        track.set_length(420)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title(u'Snowfall (Extended Mix)')
        track.set_length(424)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title(u'Love Theory (Extended Mix)')
        track.set_length(299)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title(u'Canc\xfan (Extended Mix)')
        track.set_length(374)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title(u'South Side (Extended Mix)')
        track.set_length(374)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title(u'Illusions Continuous Mix')
        track.set_length(2018)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title(u'Illusions Continuous Instrumental Mix')
        track.set_length(2018)
        disc.append_track(track)

        expected.append_disc(disc)

        s = bandcamp.ReleaseScraper.from_string('http://music.approachingnirvana.com/album/illusions')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_band_discography(self):
        expected = ListResult()
        expected.set_scraper_name(None)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer \u2013 Who Killed Amanda Palmer [Alternate Tracks]')
        item.set_info('Release date: 2008-12-24')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/who-killed-amanda-palmer-alternate-tracks?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/who-killed-amanda-palmer-alternate-tracks?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'8in8 \u2013 Nighty Night')
        item.set_info('Release date: 2011-04-26')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/nighty-night?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/nighty-night?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer & The Grand Theft Orchestra \u2013 Theatre Is Evil')
        item.set_info('Release date: 2012-09-11')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/theatre-is-evil-2?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/theatre-is-evil-2?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer \u2013 The Art of Asking Playlist')
        item.set_info('Release date: 2014-11-11')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/the-art-of-asking-playlist?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/the-art-of-asking-playlist?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer \u2013 Amanda Palmer Performs The Popular Hits Of Radiohead On Her Magical Ukulele')
        item.set_info('Release date: 2010-07-20')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/amanda-palmer-performs-the-popular-hits-of-radiohead-on-her-magical-ukulele?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/amanda-palmer-performs-the-popular-hits-of-radiohead-on-her-magical-ukulele?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Tristan Allen \u2013 Tristan Allen')
        item.set_info('Release date: 2010-12-12')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/tristan-allen?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/tristan-allen?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u"Amanda Palmer & Friends \u2013 AFP's Webcastacular NYC Extravaganzaca!")
        item.set_info('Release date: 2010-09-23')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/afps-webcastacular-nyc-extravaganzaca?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/afps-webcastacular-nyc-extravaganzaca?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer \u2013 Who Killed Amanda Palmer')
        item.set_info('Release date: 2008-09-16')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/who-killed-amanda-palmer?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/who-killed-amanda-palmer?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer & Murder By Death \u2013 7 Series (Part 3)')
        item.set_info('Release date: 2009-05-15')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/7-series-part-3?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/7-series-part-3?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer \u2013 Amanda Palmer Goes Down Under')
        item.set_info('Release date: 2011-01-21')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/amanda-palmer-goes-down-under?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/amanda-palmer-goes-down-under?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Amanda Palmer, The Young Punx, and Peaches \u2013 Map of Tasmania: The Remix Project')
        item.set_info('Release date: 2011-04-10')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/map-of-tasmania-the-remix-project?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/map-of-tasmania-the-remix-project?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Neil Gaiman and Amanda Palmer \u2013 An Evening With Neil Gaiman and Amanda Palmer')
        item.set_info('Release date: 2013-11-19')
        item.set_query(u'http://amandapalmer.bandcamp.com/album/an-evening-with-neil-gaiman-and-amanda-palmer?pk=459')
        item.set_url(u'http://amandapalmer.bandcamp.com/album/an-evening-with-neil-gaiman-and-amanda-palmer?pk=459')
        expected.append_item(item)

        s = bandcamp.DiscographyScraper.from_string('http://amandapalmer.bandcamp.com')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_band_discogrpahy_non_bandcamp_url(self):
        expected = ListResult()
        expected.set_scraper_name(None)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 All Delighted People EP')
        item.set_info('Release date: 2010-08-20')
        item.set_query(u'http://music.sufjan.com/album/all-delighted-people-ep?pk=459')
        item.set_url(u'http://music.sufjan.com/album/all-delighted-people-ep?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 Illinois')
        item.set_info('Release date: 2005-07-05')
        item.set_query(u'http://music.sufjan.com/album/illinois?pk=459')
        item.set_url(u'http://music.sufjan.com/album/illinois?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 Songs for Christmas')
        item.set_info('Release date: 2006-11-21')
        item.set_query(u'http://music.sufjan.com/album/songs-for-christmas?pk=459')
        item.set_url(u'http://music.sufjan.com/album/songs-for-christmas?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 A Sun Came')
        item.set_info('Release date: 2004-07-20')
        item.set_query(u'http://music.sufjan.com/album/a-sun-came?pk=459')
        item.set_url(u'http://music.sufjan.com/album/a-sun-came?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 The Avalanche')
        item.set_info('Release date: 2006-07-11')
        item.set_query(u'http://music.sufjan.com/album/the-avalanche?pk=459')
        item.set_url(u'http://music.sufjan.com/album/the-avalanche?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 The BQE')
        item.set_info('Release date: 2009-10-20')
        item.set_query(u'http://music.sufjan.com/album/the-bqe?pk=459')
        item.set_url(u'http://music.sufjan.com/album/the-bqe?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 Silver & Gold')
        item.set_info('Release date: 2012-11-13')
        item.set_query(u'http://music.sufjan.com/album/silver-gold?pk=459')
        item.set_url(u'http://music.sufjan.com/album/silver-gold?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 Michigan')
        item.set_info('Release date: 2003-07-01')
        item.set_query(u'http://music.sufjan.com/album/michigan?pk=459')
        item.set_url(u'http://music.sufjan.com/album/michigan?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 Carrie & Lowell')
        item.set_info('Release date: 2015-03-31')
        item.set_query(u'http://music.sufjan.com/album/carrie-lowell?pk=459')
        item.set_url(u'http://music.sufjan.com/album/carrie-lowell?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 Enjoy Your Rabbit')
        item.set_info('Release date: 2002-04-16')
        item.set_query(u'http://music.sufjan.com/album/enjoy-your-rabbit?pk=459')
        item.set_url(u'http://music.sufjan.com/album/enjoy-your-rabbit?pk=459')
        expected.append_item(item)

        item = expected.create_item()
        item.set_name(u'Sufjan Stevens \u2013 The Age of Adz')
        item.set_info('Release date: 2010-10-12')
        item.set_query(u'http://music.sufjan.com/album/the-age-of-adz?pk=459')
        item.set_url(u'http://music.sufjan.com/album/the-age-of-adz?pk=459')
        expected.append_item(item)

        s = bandcamp.DiscographyScraper('http://music.sufjan.com')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = bandcamp.ReleaseScraper.from_string('http://blubb.bla.com/album/blubb')
        r = s.get_result()

        self.assertEqual(expected, r)


@unittest.skip("skipping Musik-Sammler tests until scraper is fixed")
class MusikSammlerTest(TestCase):

    def test_simple_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('1994')
        release_event.set_country('Niederlande')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Re-Release, Remastered')

        label_id = expected.create_label_id()
        label_id.set_label('EMI Records Ltd.')
        label_id.append_catalogue_nr('7243 8 29752 2 9')
        expected.append_label_id(label_id)

        expected.set_title('Dark Side Of The Moon')

        artist = expected.create_artist()
        artist.set_name('Pink Floyd')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Rock')
        expected.append_genre('Progressive Rock')
        expected.append_genre('Psychedelic Rock')

        expected.set_url('http://www.musik-sammler.de/media/830798/')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('(a) Speak To Me (b) Breathe')
        track.set_length(237)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('On The Run')
        track.set_length(215)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Time')
        track.set_length(424)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('The Great Gig In The Sky')
        track.set_length(287)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Money')
        track.set_length(382)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Us And Them')
        track.set_length(470)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Any Colour You Like')
        track.set_length(205)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Brain Damage')
        track.set_length(230)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Eclipse')
        track.set_length(121)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/830798/')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_multiple_discs(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2011')
        release_event.set_country('Japan')
        expected.append_release_event(release_event)

        expected.set_format(u'2-CD, Pappschuber, Re-Release, Remastered, Digisleeve')

        label_id = expected.create_label_id()
        label_id.set_label('EMI Japan')
        label_id.append_catalogue_nr('TOCP 71163 64')
        expected.append_label_id(label_id)

        expected.set_title('The Dark Side Of The Moon')

        artist = expected.create_artist()
        artist.set_name('Pink Floyd')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Rock')
        expected.append_genre('Psychedelic Rock')

        expected.set_url('http://www.musik-sammler.de/media/883773')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Speak To Me')
        track.set_length(67)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Breathe (In The Air)')
        track.set_length(169)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('On The Run')
        track.set_length(225)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Time')
        track.set_length(413)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('The Great Gig In The Sky')
        track.set_length(284)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Money')
        track.set_length(383)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Us And Them')
        track.set_length(469)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Any Colour You Like')
        track.set_length(206)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Brain Damage')
        track.set_length(226)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Eclipse')
        track.set_length(132)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Speak To Me')
        track.set_length(165)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Breathe (In The Air)')
        track.set_length(170)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('On The Run')
        track.set_length(308)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Time')
        track.set_length(391)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('The Great Gig In The Sky')
        track.set_length(410)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Money')
        track.set_length(521)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Us And Them')
        track.set_length(489)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Any Colour You Like')
        track.set_length(490)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Brain Damage')
        track.set_length(223)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Eclipse')
        track.set_length(139)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/883773')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2002')
        release_event.set_country(u'\xd6sterreich')
        expected.append_release_event(release_event)

        expected.set_format(u'Split-CD, Cardsleeve')

        label_id = expected.create_label_id()
        label_id.set_label('Din Records')
        label_id.append_catalogue_nr('din cds 2 / EFA 51665-2')
        expected.append_label_id(label_id)

        expected.set_title('Icol Diston')

        artist = expected.create_artist()
        artist.set_name('Arovane')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        artist = expected.create_artist()
        artist.set_name('Dynamo')
        artist.set_various(False)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Techno')
        expected.append_genre('Electronic')
        expected.append_genre('Ambient')
        expected.append_genre('Electro')
        expected.append_genre('Freeform')

        expected.set_url('http://www.musik-sammler.de/media/512755')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('I.O.')
        track.set_length(374)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Parf')
        track.set_length(374)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Torn')
        track.set_length(417)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Andar')
        track.set_length(464)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Icol Diston')
        track.set_length(19)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Yua:E')
        track.set_length(491)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Icol Vern')
        track.set_length(303)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Nacrath')
        track.set_length(298)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Acval')
        track.set_length(306)
        track_artist = expected.create_artist()
        track_artist.set_name('Arovane')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title(u'Au\xdfen Vor Amx')
        track.set_length(560)
        track_artist = expected.create_artist()
        track_artist.set_name('Dynamo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('No. 8 Amx')
        track.set_length(825)
        track_artist = expected.create_artist()
        track_artist.set_name(None)
        track_artist.set_various(True)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/512755')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_various_artists(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date(None)
        release_event.set_country('Deutschland')
        expected.append_release_event(release_event)

        expected.set_format(u'2-CD, Erstauflage')

        label_id = expected.create_label_id()
        label_id.set_label('BCM Records GmbH')
        label_id.append_catalogue_nr('55359')
        expected.append_label_id(label_id)

        expected.set_title('Grooves Loops & Patterns Vol.1 + Vol.2')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Techno')
        expected.append_genre('Electronic')
        expected.append_genre('Breakbeat')
        expected.append_genre('Electro')

        expected.set_url('http://www.musik-sammler.de/media/313881')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Latin Disco [130 Bpm]')
        track.set_length(174)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Straight Disco [131 Bpm]')
        track.set_length(187)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Medium Disco [116 Bpm]')
        track.set_length(195)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Slow Disco [87 Bpm]')
        track.set_length(215)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('UK Happy Disco I [118 Bpm]')
        track.set_length(238)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('UK Happy Disco II [116 Bpm]')
        track.set_length(242)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('UK Happy Disco III [121 Bpm]')
        track.set_length(250)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Sexy Disco [107 Bpm]')
        track.set_length(288)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Ethno Disco [98 Bpm]')
        track.set_length(275)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Us Disco [120 Bpm]')
        track.set_length(160)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Cuba Disco [122 Bpm]')
        track.set_length(169)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Dance Floor Disco I [125 Bpm]')
        track.set_length(242)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Dance Floor Disco II [122,5 Bpm]')
        track.set_length(240)
        disc.append_track(track)

        expected.append_disc(disc)

        disc = expected.create_disc()
        disc.set_number(2)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('Straight Rock [120 Bpm]')
        track.set_length(175)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Medium Rock [132 Bpm]')
        track.set_length(158)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Fast Rock [160 Bpm]')
        track.set_length(162)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Rock Ballad [71 Bpm]')
        track.set_length(238)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Medium Rock Balad [106 Bpm]')
        track.set_length(195)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Funk Rock [108 Bpm]')
        track.set_length(191)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Latin Rock [122 Bpm]')
        track.set_length(175)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Hard Rock Shuffle [132 Bpm]')
        track.set_length(158)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Medium Rock Shuffle [99 Bpm]')
        track.set_length(170)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Rhythm & Blues [118 Bpm]')
        track.set_length(159)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('5/4 Freak Rock [165 Bpm]')
        track.set_length(140)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Rockabilly [123 Bpm]')
        track.set_length(154)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('Country Rock [92 Bpm]')
        track.set_length(204)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/313881')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_va_album(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('1986')
        release_event.set_country('USA')
        expected.append_release_event(release_event)

        expected.set_format(u'LP')

        label_id = expected.create_label_id()
        label_id.set_label('Capitol Records, Inc.')
        label_id.append_catalogue_nr('SV-12499')
        expected.append_label_id(label_id)

        expected.set_title('Iron Eagle - Original Motion Picture Soundtrack')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Soundtrack')

        expected.set_url('http://www.musik-sammler.de/media/43567')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('One Vision')
        track.set_length(240)
        track_artist = expected.create_artist()
        track_artist.set_name('Queen')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Iron Eagle (Never Say Die)')
        track.set_length(208)
        track_artist = expected.create_artist()
        track_artist.set_name('King Kobra')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('These Are The Good Times')
        track.set_length(225)
        track_artist = expected.create_artist()
        track_artist.set_name('Eric Martin')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('Maniac House')
        track.set_length(294)
        track_artist = expected.create_artist()
        track_artist.set_name('Katrina & The Waves')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Intense')
        track.set_length(270)
        track_artist = expected.create_artist()
        track_artist.set_name('George Clinton')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Hide The Rainbow')
        track.set_length(235)
        track_artist = expected.create_artist()
        track_artist.set_name('Dio')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title("It's Too Late")
        track.set_length(186)
        track_artist = expected.create_artist()
        track_artist.set_name('Helix')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title('Road Of The Gypsy')
        track.set_length(268)
        track_artist = expected.create_artist()
        track_artist.set_name('Adrenalin')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Love Can Make You Cry')
        track.set_length(258)
        track_artist = expected.create_artist()
        track_artist.set_name('Urgent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('This Raging Fire')
        track.set_length(246)
        track_artist = expected.create_artist()
        track_artist.set_name('Jon Butcher Axis')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/43567')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_featuring_track_artist(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2008')
        release_event.set_country('Deutschland')
        expected.append_release_event(release_event)

        expected.set_format(u'CD, Heftbeilage, Digipak')

        label_id = expected.create_label_id()
        label_id.set_label('Batbeliever Releases')
        label_id.append_catalogue_nr('BAT 048')
        expected.append_label_id(label_id)

        expected.set_title('Gothic File 05')

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Dark Wave')
        expected.append_genre('Gothic')

        expected.set_url('http://www.musik-sammler.de/media/257802')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title('O Varium Fortune')
        track.set_length(352)
        track_artist = expected.create_artist()
        track_artist.set_name('Corvus Corax')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('Zaubererbruder [EP-Version]')
        track.set_length(285)
        track_artist = expected.create_artist()
        track_artist.set_name('ASP')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Eric Fish')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Mein Gral')
        track.set_length(236)
        track_artist = expected.create_artist()
        track_artist.set_name('Megaherz')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title(u'Komm S\xfc\xdfer Tod')
        track.set_length(275)
        track_artist = expected.create_artist()
        track_artist.set_name('Eisbrecher')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('Get Some Sleep [Exclusive Version]')
        track.set_length(252)
        track_artist = expected.create_artist()
        track_artist.set_name('Mono Inc.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Prayer Before Birth [Underwaterpilots Remix]')
        track.set_length(263)
        track_artist = expected.create_artist()
        track_artist.set_name('Anne Clark')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('Haufenweise Scheisse (XL)')
        track.set_length(320)
        track_artist = expected.create_artist()
        track_artist.set_name(u'Grossstadtgefl\xfcster')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title(u'D\xe9cadence')
        track.set_length(191)
        track_artist = expected.create_artist()
        track_artist.set_name('Charles De Goal')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Burning Up')
        track.set_length(248)
        track_artist = expected.create_artist()
        track_artist.set_name('Ladytron')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Horizon [Remastered]')
        track.set_length(326)
        track_artist = expected.create_artist()
        track_artist.set_name('Black Orchid')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Play Games')
        track.set_length(212)
        track_artist = expected.create_artist()
        track_artist.set_name('The Rorschach Garden')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('All Ends')
        track.set_length(256)
        track_artist = expected.create_artist()
        track_artist.set_name('Imatem')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('All About The Now')
        track.set_length(289)
        track_artist = expected.create_artist()
        track_artist.set_name('Miserylab')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title('Hymn Of The Shades')
        track.set_length(202)
        track_artist = expected.create_artist()
        track_artist.set_name('Descendants Of Cain')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Bleed')
        track.set_length(244)
        track_artist = expected.create_artist()
        track_artist.set_name('ELA')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('Never Stop Crying')
        track.set_length(254)
        track_artist = expected.create_artist()
        track_artist.set_name("Jennie Tebler's Out Of Oblivion")
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title('Killhoney')
        track.set_length(299)
        track_artist = expected.create_artist()
        track_artist.set_name('End Of Green')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/257802')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_album_with_multiple_unsplit_artist_names(self):
        expected = ReleaseResult()
        expected.set_scraper_name(None)

        release_event = expected.create_release_event()
        release_event.set_date('2005')
        release_event.set_country('USA')
        expected.append_release_event(release_event)

        expected.set_format(u'CD')

        label_id = expected.create_label_id()
        label_id.set_label('G Unit / Interscope Records')
        expected.append_label_id(label_id)

        expected.set_title("Get Rich Or Die Tryin' (Music From And Inspired By The Motion Picture)")

        artist = expected.create_artist()
        artist.set_name(None)
        artist.set_various(True)
        artist.append_type(expected.ArtistTypes.MAIN)
        expected.append_release_artist(artist)

        expected.append_genre('Soundtrack')

        expected.set_url('http://www.musik-sammler.de/media/154887')

        disc = expected.create_disc()
        disc.set_number(1)
        disc.set_title(None)

        track = disc.create_track()
        track.set_number('1')
        track.set_title("Hustler's Ambition")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('2')
        track.set_title('What If')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('3')
        track.set_title('Things Change')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Spider Loc')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent & Lloyd Banks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('4')
        track.set_title('You Already Know')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Lloyd Banks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent & Young Buck')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('5')
        track.set_title('When Death Becomes You')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('M.O.P.')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('6')
        track.set_title('Have A Party')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Mobb Deep')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent & Nate Dogg')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('7')
        track.set_title('We Both Think Alike')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Olivia')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('8')
        track.set_title("Don't Need No Help")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Young Buck')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('9')
        track.set_title('Get Low')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Lloyd Banks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('10')
        track.set_title('Fake Love')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Tony Yayo')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('11')
        track.set_title('Window Shopper')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('12')
        track.set_title('Born Alone, Die Alone')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Lloyd Banks')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('13')
        track.set_title('You A Shooter')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('Mobb Deep')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('14')
        track.set_title("I Don't Know Officer")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        track_artist = expected.create_artist()
        track_artist.set_name('Lloyd Banks, Prodigy, Spider Loc & Mase')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.FEATURING)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('15')
        track.set_title('Talk About Me')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('16')
        track.set_title('When It Rains It Pours')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('17')
        track.set_title('Best Friend')
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        track = disc.create_track()
        track.set_number('18')
        track.set_title("I'll Whip Ya Head Boy")
        track.set_length(None)
        track_artist = expected.create_artist()
        track_artist.set_name('50 Cent & Young Buck')
        track_artist.set_various(False)
        track_artist.append_type(expected.ArtistTypes.MAIN)
        track.append_artist(track_artist)
        disc.append_track(track)

        expected.append_disc(disc)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/154887')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_404(self):
        expected = NotFoundResult()
        expected.set_scraper_name(None)

        s = musiksammler.ReleaseScraper.from_string('http://www.musik-sammler.de/media/99999999999999')
        r = s.get_result()

        self.assertEqual(expected, r)

    def test_search_scraper(self):
        s = musiksammler.SearchScraper('love')
        r = s.get_result()

        self.assertTrue(len(r.get_items()) > 0)