adapt adecco module to console application
This commit is contained in:
parent
48f0054e91
commit
b585bc2150
2 changed files with 7 additions and 3 deletions
|
|
@ -21,7 +21,7 @@
|
|||
from weboob.tools.backend import BaseBackend
|
||||
from weboob.capabilities.job import ICapJob
|
||||
from .browser import AdeccoBrowser
|
||||
|
||||
from .job import AdeccoJobAdvert
|
||||
|
||||
__all__ = ['AdeccoBackend']
|
||||
|
||||
|
|
@ -40,6 +40,11 @@ class AdeccoBackend(BaseBackend, ICapJob):
|
|||
for advert in self.browser.search_job(pattern):
|
||||
yield advert
|
||||
|
||||
def get_job_advert(self, _id, advert):
|
||||
def get_job_advert(self, _id, advert=None):
|
||||
with self.browser:
|
||||
return self.browser.get_job_advert(_id, advert)
|
||||
|
||||
def fill_obj(self, advert, fields):
|
||||
self.get_job_advert(advert.id, advert)
|
||||
|
||||
OBJECTS = {AdeccoJobAdvert: fill_obj}
|
||||
|
|
|
|||
|
|
@ -28,5 +28,4 @@ class AdeccoTest(BackendTest):
|
|||
l = list(self.backend.search_job(u'valet de chambre'))
|
||||
assert len(l)
|
||||
advert = self.backend.get_job_advert(l[0].id, None)
|
||||
print advert.__repr__()
|
||||
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue