예제 #1
0
    def test_search_places(self):
        musicbrainzngs.search_places("Fillmore")
        self.assertEqual("http://musicbrainz.org/ws/2/place/?query=Fillmore", self.opener.get_url())

        musicbrainzngs.search_places(place="Fillmore")
        expected_query = 'place:(fillmore)'
        expected = 'http://musicbrainz.org/ws/2/place/?query=%s' % musicbrainzngs.compat.quote_plus(expected_query)
        self.assertEquals(expected, self.opener.get_url())

        # Invalid query field
        with self.assertRaises(musicbrainzngs.InvalidSearchFieldError):
            musicbrainzngs.search_places(foo="value")
예제 #2
0
def search_places(query='', limit=None, offset=None):
    """Search for places."""
    api_resp = musicbrainzngs.search_places(query=query, limit=limit, offset=offset)
    return api_resp.get('place-count'), api_resp.get('place-list')
예제 #3
0
def search_places(query='', limit=None, offset=None):
    """Search for places."""
    api_resp = musicbrainzngs.search_places(query=query,
                                            limit=limit,
                                            offset=offset)
    return api_resp.get('place-count'), api_resp.get('place-list')
 def testSearchPlace(self):
     musicbrainzngs.search_places("Fillmore")
     self.assertEqual("http://musicbrainz.org/ws/2/place/?query=Fillmore",
                      self.opener.get_url())
 def testSearchPlace(self):
     musicbrainzngs.search_places("Fillmore")
     self.assertEqual("http://musicbrainz.org/ws/2/place/?query=Fillmore", self.opener.get_url())