def get_recordings_by_puid(puid, includes=[], release_status=[],
                           release_type=[]):
    """Search for recordings with a :musicbrainz:`PUID`.
    (not available on server)"""
    warn("PUID support was removed from the server\n"
         "and no PUIDs will be found (404)",
         Warning, stacklevel=2)
    raise ResponseError(cause=compat.HTTPError(
                                            None, 404, "Not Found", None, None))
def get_recordings_by_echoprint(echoprint, includes=[], release_status=[],
                                release_type=[]):
    """Search for recordings with an `echoprint <http://echoprint.me>`_.
    (not available on server)"""
    warn("Echoprints were never introduced\n"
         "and will not be found (404)",
         Warning, stacklevel=2)
    raise ResponseError(cause=compat.HTTPError(
                                            None, 404, "Not Found", None, None))
Пример #3
0
 def test_list_baduuid(self):
     exc = compat.HTTPError("", 400, "", "", _common.StringIO.StringIO(""))
     self.opener = _common.FakeOpener(
         exception=musicbrainzngs.ResponseError(cause=exc))
     musicbrainzngs.compat.build_opener = lambda *args: self.opener
     try:
         res = caa.get_image_list("8ec178f4-a8e8-4f22-bcba-19644XXXXXX")
         self.assertTrue(False, "Expected an exception")
     except musicbrainzngs.ResponseError as e:
         self.assertEqual(e.cause.code, 400)
    def test_no_collection(self):
        """ If a collection doesn't exist, you get a 404 """

        exc = compat.HTTPError("", 404, "", "", _common.StringIO.StringIO(""))
        self.opener = _common.FakeOpener(exception=musicbrainzngs.ResponseError(cause=exc))
        musicbrainzngs.compat.build_opener = lambda *args: self.opener
        try:
            res = musicbrainzngs.get_releases_in_collection("17905fdb-102d-40f0-91d3-eabcabc64f44")
            self.assertTrue(False, "Expected an exception")
        except musicbrainzngs.ResponseError as e:
            self.assertEqual(e.cause.code, 404)
    def test_private_collection(self):
        """ If you ask for a collection that is private, you should
        get a 401"""

        exc = compat.HTTPError("", 401, "", "", _common.StringIO.StringIO(""))
        self.opener = _common.FakeOpener(exception=musicbrainzngs.AuthenticationError(cause=exc))
        musicbrainzngs.compat.build_opener = lambda *args: self.opener
        try:
            res = musicbrainzngs.get_releases_in_collection("17905fdb-102d-40f0-91d3-eabcabc64fd3")
            self.assertTrue(False, "Expected an exception")
        except musicbrainzngs.AuthenticationError as e:
            self.assertEqual(e.cause.code, 401)