diff --git a/modules/geolocip/backend.py b/modules/geolocip/backend.py index dbb3c129..40a3d3e8 100644 --- a/modules/geolocip/backend.py +++ b/modules/geolocip/backend.py @@ -57,10 +57,10 @@ class GeolocIpBackend(BaseBackend, ICapGeolocIp): tab[key] = value last_line = line iploc = IpLocation(ipaddr) - iploc.city = tab['City'] - iploc.region = tab['Region'] - iploc.zipcode = tab['Postal code'] - iploc.country = tab['Country name'] + iploc.city = u'%s'%tab['City'] + iploc.region = u'%s'%tab['Region'] + iploc.zipcode = u'%s'%tab['Postal code'] + iploc.country = u'%s'%tab['Country name'] if tab['Latitude'] != '': iploc.lt = float(tab['Latitude']) else: diff --git a/modules/imdb/test.py b/modules/imdb/test.py index e12ed63e..e337a83f 100644 --- a/modules/imdb/test.py +++ b/modules/imdb/test.py @@ -24,16 +24,40 @@ from weboob.tools.test import BackendTest class ImdbTest(BackendTest): BACKEND = 'imdb' - def test_movie(self): + def test_search_movie(self): movies = list(self.backend.iter_movies('spiderman')) for movie in movies: assert movie.id - assert movie.original_title - assert movie.release_date - def test_persons(self): - persons = list(self.backend.iter_persons('robert')) + def test_get_movie(self): + movie = self.backend.get_movie('tt0079980') + assert movie.id + assert movie.original_title + + def test_search_person(self): + persons = list(self.backend.iter_persons('dewaere')) + for person in persons: + assert person.id + + def test_get_person(self): + person = self.backend.get_person('nm0223033') + assert person.id + assert person.name + assert person.birth_date + + def test_movie_persons(self): + persons = list(self.backend.iter_movie_persons('tt0079980')) for person in persons: assert person.id assert person.name - assert person.birth_date + + def test_person_movies(self): + movies = list(self.backend.iter_person_movies('nm0223033')) + for movie in movies: + assert movie.id + assert movie.original_title + + def test_get_person_biography(self): + bio = self.backend.get_person_biography('nm0223033') + assert bio != '' + assert bio != None