change rules :
- search command will search using pattern (None accepted) - ls command will display result of advanced search
This commit is contained in:
parent
e2476bfb0e
commit
33641953fc
12 changed files with 360 additions and 292 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||||
|
from weboob.capabilities.collection import ICapCollection, CollectionNotFound
|
||||||
from weboob.tools.ordereddict import OrderedDict
|
from weboob.tools.ordereddict import OrderedDict
|
||||||
from weboob.tools.value import Value
|
from weboob.tools.value import Value
|
||||||
from weboob.capabilities.job import ICapJob
|
from weboob.capabilities.job import ICapJob
|
||||||
|
|
@ -28,7 +29,7 @@ from .job import AdeccoJobAdvert
|
||||||
__all__ = ['AdeccoBackend']
|
__all__ = ['AdeccoBackend']
|
||||||
|
|
||||||
|
|
||||||
class AdeccoBackend(BaseBackend, ICapJob):
|
class AdeccoBackend(BaseBackend, ICapJob, ICapCollection):
|
||||||
NAME = 'adecco'
|
NAME = 'adecco'
|
||||||
DESCRIPTION = u'adecco website'
|
DESCRIPTION = u'adecco website'
|
||||||
MAINTAINER = u'Bezleputh'
|
MAINTAINER = u'Bezleputh'
|
||||||
|
|
@ -280,8 +281,14 @@ class AdeccoBackend(BaseBackend, ICapJob):
|
||||||
|
|
||||||
def search_job(self, pattern=None):
|
def search_job(self, pattern=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
for advert in self.browser.search_job(pattern,
|
for advert in self.browser.search_job(pattern):
|
||||||
publication_date=int(self.config['publication_date'].get()),
|
yield advert
|
||||||
|
|
||||||
|
def iter_resources(self, objs, split_path):
|
||||||
|
with self.browser:
|
||||||
|
collection = self.get_collection(objs, split_path)
|
||||||
|
if collection.path_level == 0:
|
||||||
|
for advert in self.browser.advanced_search_job(publication_date=int(self.config['publication_date'].get()),
|
||||||
conty=int(self.config['conty'].get()),
|
conty=int(self.config['conty'].get()),
|
||||||
region=int(self.config['region'].get()),
|
region=int(self.config['region'].get()),
|
||||||
job_category=int(self.config['job_category'].get()),
|
job_category=int(self.config['job_category'].get()),
|
||||||
|
|
@ -289,6 +296,11 @@ class AdeccoBackend(BaseBackend, ICapJob):
|
||||||
):
|
):
|
||||||
yield advert
|
yield advert
|
||||||
|
|
||||||
|
def validate_collection(self, objs, collection):
|
||||||
|
if collection.path_level == 0:
|
||||||
|
return
|
||||||
|
raise CollectionNotFound(collection.split_path)
|
||||||
|
|
||||||
def get_job_advert(self, _id, advert=None):
|
def get_job_advert(self, _id, advert=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
return self.browser.get_job_advert(_id, advert)
|
return self.browser.get_job_advert(_id, advert)
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,12 @@ class AdeccoBrowser(BaseBrowser):
|
||||||
}
|
}
|
||||||
|
|
||||||
def search_job(self, pattern=None, publication_date=None, conty=None, region=None, job_category=None, activity_domain=None):
|
def search_job(self, pattern=None, publication_date=None, conty=None, region=None, job_category=None, activity_domain=None):
|
||||||
if pattern:
|
self.location('%s://%s/trouver-un-emploi/Pages/Offres-d-emploi.aspx?keywords=%s'
|
||||||
self.location('%s://%s/trouver-un-emploi/Pages/Offres-d-emploi.aspx?keywords=%s' % (self.PROTOCOL, self.DOMAIN, pattern.replace(' ', '+')))
|
% (self.PROTOCOL, self.DOMAIN, pattern.replace(' ', '+')))
|
||||||
else:
|
assert self.is_on_page(SearchPage)
|
||||||
|
return self.page.iter_job_adverts()
|
||||||
|
|
||||||
|
def advanced_search_job(self, publication_date=None, conty=None, region=None, job_category=None, activity_domain=None):
|
||||||
data = {
|
data = {
|
||||||
'publicationDate': publication_date,
|
'publicationDate': publication_date,
|
||||||
'department': conty,
|
'department': conty,
|
||||||
|
|
@ -47,7 +50,8 @@ class AdeccoBrowser(BaseBrowser):
|
||||||
'jobCategory': job_category,
|
'jobCategory': job_category,
|
||||||
'activityDomain': activity_domain,
|
'activityDomain': activity_domain,
|
||||||
}
|
}
|
||||||
self.location('%s://%s/trouver-un-emploi/Pages/Offres-d-emploi.aspx?%s' % (self.PROTOCOL, self.DOMAIN, urllib.urlencode(data)))
|
self.location('%s://%s/trouver-un-emploi/Pages/Offres-d-emploi.aspx?%s'
|
||||||
|
% (self.PROTOCOL, self.DOMAIN, urllib.urlencode(data)))
|
||||||
assert self.is_on_page(SearchPage)
|
assert self.is_on_page(SearchPage)
|
||||||
return self.page.iter_job_adverts()
|
return self.page.iter_job_adverts()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,14 @@ from weboob.tools.test import BackendTest
|
||||||
class AdeccoTest(BackendTest):
|
class AdeccoTest(BackendTest):
|
||||||
BACKEND = 'adecco'
|
BACKEND = 'adecco'
|
||||||
|
|
||||||
def test_adecco(self):
|
def test_adecco_search(self):
|
||||||
l = list(self.backend.search_job(u'valet de chambre'))
|
l = list(self.backend.search_job(u'valet de chambre'))
|
||||||
assert len(l)
|
assert len(l)
|
||||||
advert = self.backend.get_job_advert(l[0].id, None)
|
advert = self.backend.get_job_advert(l[0].id, None)
|
||||||
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||||
|
|
||||||
|
def test_adecco_advanced_search(self):
|
||||||
|
l = list(self.backend.iter_resources([], []))
|
||||||
|
assert len(l)
|
||||||
|
advert = self.backend.get_job_advert(l[0].id, None)
|
||||||
|
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||||
|
from weboob.capabilities.collection import ICapCollection, CollectionNotFound
|
||||||
from weboob.capabilities.job import ICapJob
|
from weboob.capabilities.job import ICapJob
|
||||||
from weboob.tools.ordereddict import OrderedDict
|
from weboob.tools.ordereddict import OrderedDict
|
||||||
from weboob.tools.value import Value
|
from weboob.tools.value import Value
|
||||||
|
|
@ -28,7 +29,7 @@ from .job import ApecJobAdvert
|
||||||
__all__ = ['ApecBackend']
|
__all__ = ['ApecBackend']
|
||||||
|
|
||||||
|
|
||||||
class ApecBackend(BaseBackend, ICapJob):
|
class ApecBackend(BaseBackend, ICapJob, ICapCollection):
|
||||||
NAME = 'apec'
|
NAME = 'apec'
|
||||||
DESCRIPTION = u'apec website'
|
DESCRIPTION = u'apec website'
|
||||||
MAINTAINER = u'Bezleputh'
|
MAINTAINER = u'Bezleputh'
|
||||||
|
|
@ -229,8 +230,14 @@ class ApecBackend(BaseBackend, ICapJob):
|
||||||
|
|
||||||
def search_job(self, pattern=None):
|
def search_job(self, pattern=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
for job_advert in self.browser.search_job(pattern=pattern,
|
for job_advert in self.browser.search_job(pattern=pattern):
|
||||||
region=self.config['place'].get(),
|
yield job_advert
|
||||||
|
|
||||||
|
def iter_resources(self, objs, split_path):
|
||||||
|
with self.browser:
|
||||||
|
collection = self.get_collection(objs, split_path)
|
||||||
|
if collection.path_level == 0:
|
||||||
|
for job_advert in self.browser.advanced_search_job(region=self.config['place'].get(),
|
||||||
fonction=self.config['fonction'].get(),
|
fonction=self.config['fonction'].get(),
|
||||||
secteur=self.config['secteur'].get(),
|
secteur=self.config['secteur'].get(),
|
||||||
salaire=self.config['salaire'].get(),
|
salaire=self.config['salaire'].get(),
|
||||||
|
|
@ -239,6 +246,11 @@ class ApecBackend(BaseBackend, ICapJob):
|
||||||
level=self.config['level'].get()):
|
level=self.config['level'].get()):
|
||||||
yield job_advert
|
yield job_advert
|
||||||
|
|
||||||
|
def validate_collection(self, objs, collection):
|
||||||
|
if collection.path_level == 0:
|
||||||
|
return
|
||||||
|
raise CollectionNotFound(collection.split_path)
|
||||||
|
|
||||||
def get_job_advert(self, _id, advert=None):
|
def get_job_advert(self, _id, advert=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
return self.browser.get_job_advert(_id, advert)
|
return self.browser.get_job_advert(_id, advert)
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,13 @@ class ApecBrowser(BaseBrowser):
|
||||||
'http://cadres.apec.fr/offres-emploi-cadres/offres-emploi-cadres/\d*_\d*_\d*_(.*?)________(.*?).html(.*?)': AdvertPage,
|
'http://cadres.apec.fr/offres-emploi-cadres/offres-emploi-cadres/\d*_\d*_\d*_(.*?)________(.*?).html(.*?)': AdvertPage,
|
||||||
}
|
}
|
||||||
|
|
||||||
def search_job(self, pattern=None, region=None, fonction=None, secteur=None, salaire=None, contrat=None, limit_date=None, level=None):
|
def search_job(self, pattern=None):
|
||||||
if pattern:
|
|
||||||
self.location('http://cadres.apec.fr/MesOffres/RechercheOffres/ApecRechercheOffre.jsp?keywords=%s'
|
self.location('http://cadres.apec.fr/MesOffres/RechercheOffres/ApecRechercheOffre.jsp?keywords=%s'
|
||||||
% pattern.replace(' ', '+'))
|
% pattern.replace(' ', '+'))
|
||||||
else:
|
assert self.is_on_page(SearchPage)
|
||||||
|
return self.page.iter_job_adverts()
|
||||||
|
|
||||||
|
def advanced_search_job(self, region=None, fonction=None, secteur=None, salaire=None, contrat=None, limit_date=None, level=None):
|
||||||
self.location(
|
self.location(
|
||||||
'http://cadres.apec.fr/liste-offres-emploi-cadres/8_0___%s_%s_%s_%s_%s_%s_%s_offre-d-emploi.html'
|
'http://cadres.apec.fr/liste-offres-emploi-cadres/8_0___%s_%s_%s_%s_%s_%s_%s_offre-d-emploi.html'
|
||||||
% (
|
% (
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,14 @@ from weboob.tools.test import BackendTest
|
||||||
class ApecTest(BackendTest):
|
class ApecTest(BackendTest):
|
||||||
BACKEND = 'apec'
|
BACKEND = 'apec'
|
||||||
|
|
||||||
def test_apec(self):
|
def test_apec_search(self):
|
||||||
l = list(self.backend.search_job(u'informaticien'))
|
l = list(self.backend.search_job(u'informaticien'))
|
||||||
assert len(l)
|
assert len(l)
|
||||||
advert = self.backend.get_job_advert(l[0].id, None)
|
advert = self.backend.get_job_advert(l[0].id, None)
|
||||||
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||||
|
|
||||||
|
def test_apec_advanced_search(self):
|
||||||
|
l = list(self.backend.iter_resources([], []))
|
||||||
|
assert len(l)
|
||||||
|
advert = self.backend.get_job_advert(l[0].id, None)
|
||||||
|
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||||
|
from weboob.capabilities.collection import ICapCollection, CollectionNotFound
|
||||||
from weboob.tools.ordereddict import OrderedDict
|
from weboob.tools.ordereddict import OrderedDict
|
||||||
from weboob.tools.value import Value
|
from weboob.tools.value import Value
|
||||||
from weboob.capabilities.job import ICapJob
|
from weboob.capabilities.job import ICapJob
|
||||||
|
|
@ -28,7 +29,7 @@ from .job import LolixJobAdvert
|
||||||
__all__ = ['LolixBackend']
|
__all__ = ['LolixBackend']
|
||||||
|
|
||||||
|
|
||||||
class LolixBackend(BaseBackend, ICapJob):
|
class LolixBackend(BaseBackend, ICapJob, ICapCollection):
|
||||||
NAME = 'lolix'
|
NAME = 'lolix'
|
||||||
DESCRIPTION = u'Lolix French free software employment website'
|
DESCRIPTION = u'Lolix French free software employment website'
|
||||||
MAINTAINER = u'Bezleputh'
|
MAINTAINER = u'Bezleputh'
|
||||||
|
|
@ -137,15 +138,21 @@ class LolixBackend(BaseBackend, ICapJob):
|
||||||
Value('contrat', label=u'Contrat', choices=contrat_choices),
|
Value('contrat', label=u'Contrat', choices=contrat_choices),
|
||||||
Value('limit_date', label=u'Date limite', choices=limit_date_choices))
|
Value('limit_date', label=u'Date limite', choices=limit_date_choices))
|
||||||
|
|
||||||
def search_job(self, pattern=None):
|
def iter_resources(self, objs, split_path):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
if not pattern:
|
collection = self.get_collection(objs, split_path)
|
||||||
for advert in self.browser.search_job(region=self.config['region'].get(),
|
if collection.path_level == 0:
|
||||||
|
for advert in self.browser.advanced_search_job(region=self.config['region'].get(),
|
||||||
poste=self.config['poste'].get(),
|
poste=self.config['poste'].get(),
|
||||||
contrat=int(self.config['contrat'].get()),
|
contrat=int(self.config['contrat'].get()),
|
||||||
limit_date=self.config['limit_date'].get()):
|
limit_date=self.config['limit_date'].get()):
|
||||||
yield advert
|
yield advert
|
||||||
|
|
||||||
|
def validate_collection(self, objs, collection):
|
||||||
|
if collection.path_level == 0:
|
||||||
|
return
|
||||||
|
raise CollectionNotFound(collection.split_path)
|
||||||
|
|
||||||
def get_job_advert(self, _id, advert=None):
|
def get_job_advert(self, _id, advert=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
return self.browser.get_job_advert(_id, advert)
|
return self.browser.get_job_advert(_id, advert)
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ class LolixBrowser(BaseBrowser):
|
||||||
'%s://%s/offre.php\?id=(?P<id>.+)' % (PROTOCOL, DOMAIN): AdvertPage,
|
'%s://%s/offre.php\?id=(?P<id>.+)' % (PROTOCOL, DOMAIN): AdvertPage,
|
||||||
}
|
}
|
||||||
|
|
||||||
def search_job(self, region=None, poste=None, contrat=None, limit_date=None):
|
def advanced_search_job(self, region=None, poste=None, contrat=None, limit_date=None):
|
||||||
data = {
|
data = {
|
||||||
'mode': 'find',
|
'mode': 'find',
|
||||||
'page': '0',
|
'page': '0',
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,8 @@ from weboob.tools.test import BackendTest
|
||||||
class LolixTest(BackendTest):
|
class LolixTest(BackendTest):
|
||||||
BACKEND = 'lolix'
|
BACKEND = 'lolix'
|
||||||
|
|
||||||
def test_lolix(self):
|
def test_lolix_advanced_search(self):
|
||||||
l = list(self.backend.search_job())
|
l = list(self.backend.iter_resources([], []))
|
||||||
assert len(l)
|
assert len(l)
|
||||||
advert = self.backend.get_job_advert(l[0].id, l[0])
|
advert = self.backend.get_job_advert(l[0].id, l[0])
|
||||||
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.backend import BaseBackend, BackendConfig
|
from weboob.tools.backend import BaseBackend, BackendConfig
|
||||||
|
from weboob.capabilities.collection import ICapCollection, CollectionNotFound
|
||||||
from weboob.capabilities.job import ICapJob
|
from weboob.capabilities.job import ICapJob
|
||||||
from weboob.tools.value import Value
|
from weboob.tools.value import Value
|
||||||
from weboob.tools.ordereddict import OrderedDict
|
from weboob.tools.ordereddict import OrderedDict
|
||||||
|
|
@ -29,7 +30,7 @@ from .job import PopolemploiJobAdvert
|
||||||
__all__ = ['PopolemploiBackend']
|
__all__ = ['PopolemploiBackend']
|
||||||
|
|
||||||
|
|
||||||
class PopolemploiBackend(BaseBackend, ICapJob):
|
class PopolemploiBackend(BaseBackend, ICapJob, ICapCollection):
|
||||||
NAME = 'popolemploi'
|
NAME = 'popolemploi'
|
||||||
DESCRIPTION = u'Pole Emploi website'
|
DESCRIPTION = u'Pole Emploi website'
|
||||||
MAINTAINER = u'Bezleputh'
|
MAINTAINER = u'Bezleputh'
|
||||||
|
|
@ -202,11 +203,21 @@ class PopolemploiBackend(BaseBackend, ICapJob):
|
||||||
|
|
||||||
def search_job(self, pattern=None):
|
def search_job(self, pattern=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
return self.browser.search_job(pattern=pattern,
|
return self.browser.search_job(pattern=pattern)
|
||||||
metier=self.config['metier'].get(),
|
|
||||||
|
def iter_resources(self, objs, split_path):
|
||||||
|
with self.browser:
|
||||||
|
collection = self.get_collection(objs, split_path)
|
||||||
|
if collection.path_level == 0:
|
||||||
|
return self.browser.advanced_search_job(metier=self.config['metier'].get(),
|
||||||
place=self.config['place'].get(),
|
place=self.config['place'].get(),
|
||||||
contrat=self.config['contrat'].get())
|
contrat=self.config['contrat'].get())
|
||||||
|
|
||||||
|
def validate_collection(self, objs, collection):
|
||||||
|
if collection.path_level == 0:
|
||||||
|
return
|
||||||
|
raise CollectionNotFound(collection.split_path)
|
||||||
|
|
||||||
def get_job_advert(self, _id, advert=None):
|
def get_job_advert(self, _id, advert=None):
|
||||||
with self.browser:
|
with self.browser:
|
||||||
return self.browser.get_job_advert(_id, advert)
|
return self.browser.get_job_advert(_id, advert)
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,12 @@ class PopolemploiBrowser(BaseBrowser):
|
||||||
}
|
}
|
||||||
|
|
||||||
def search_job(self, pattern=None, metier=None, place=None, contrat=None):
|
def search_job(self, pattern=None, metier=None, place=None, contrat=None):
|
||||||
if pattern:
|
|
||||||
self.location('http://offre.pole-emploi.fr/resultat?offresPartenaires=true&libMetier=%s'
|
self.location('http://offre.pole-emploi.fr/resultat?offresPartenaires=true&libMetier=%s'
|
||||||
% pattern.replace(' ', '+'))
|
% pattern.replace(' ', '+'))
|
||||||
else:
|
assert self.is_on_page(SearchPage)
|
||||||
|
return self.page.iter_job_adverts()
|
||||||
|
|
||||||
|
def advanced_search_job(self, metier=None, place=None, contrat=None):
|
||||||
data = {
|
data = {
|
||||||
't:formdata': 'H4sIAAAAAAAAAJVSwUocQRAtJ1HBPSQonoLIEo1BpPeiErJ42AQ8LYlkMRdPPW3N2trT3emu2Vkv3vIb+YIg5Bs85JZ/yAfkmlMO6d5hR0UY1oEZpqtfVb33qr7/gfnyDew7FGfowmuyzKHvDGRulcwk4luuFLoROq94jeIjrgWid3CUOWaR5YIJk+eFZsQtenKXTJ7lMWaNRk2e9aW+GBRpLqk3QvHeaMIx4caRMwK9n9x4L40+/vrj+qDVXksgOYFFUeEIVk7656FrR3E97HxMz1FQtw8tVJiH8h94jgTLdyADclIPu2MHz2OQxSCr8uD2GVtL8GKi8HNQ2Oefpgp7lcJyB7YbvMHwZ2QNCH7sGTdk3PJwqq3YCz44VDJlKffIemkIckGHEtXpxgCpsJvHN63fqz//JTAXREXRzqgo6gtcQTKO3ycEz6p2NcdHk+s9ltyD6dxcn+5mf7/9SoJ3E1ZlG9YbOCiJhY/ABYKn8TADPsKXypfQbsD5MHhB08oL1XGmnKr6Fmw2IOsrF0w7nHXD35mCjK52vGmv5+7v7b0RL922Ll/DqwaOljtCzcN8/dSG1p3Y7NkTQ/4DH0zoXggEAAA=',
|
't:formdata': 'H4sIAAAAAAAAAJVSwUocQRAtJ1HBPSQonoLIEo1BpPeiErJ42AQ8LYlkMRdPPW3N2trT3emu2Vkv3vIb+YIg5Bs85JZ/yAfkmlMO6d5hR0UY1oEZpqtfVb33qr7/gfnyDew7FGfowmuyzKHvDGRulcwk4luuFLoROq94jeIjrgWid3CUOWaR5YIJk+eFZsQtenKXTJ7lMWaNRk2e9aW+GBRpLqk3QvHeaMIx4caRMwK9n9x4L40+/vrj+qDVXksgOYFFUeEIVk7656FrR3E97HxMz1FQtw8tVJiH8h94jgTLdyADclIPu2MHz2OQxSCr8uD2GVtL8GKi8HNQ2Oefpgp7lcJyB7YbvMHwZ2QNCH7sGTdk3PJwqq3YCz44VDJlKffIemkIckGHEtXpxgCpsJvHN63fqz//JTAXREXRzqgo6gtcQTKO3ycEz6p2NcdHk+s9ltyD6dxcn+5mf7/9SoJ3E1ZlG9YbOCiJhY/ABYKn8TADPsKXypfQbsD5MHhB08oL1XGmnKr6Fmw2IOsrF0w7nHXD35mCjK52vGmv5+7v7b0RL922Ll/DqwaOljtCzcN8/dSG1p3Y7NkTQ/4DH0zoXggEAAA=',
|
||||||
'emploiRecherche': metier,
|
'emploiRecherche': metier,
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,14 @@ from weboob.tools.test import BackendTest
|
||||||
class PopolemploiTest(BackendTest):
|
class PopolemploiTest(BackendTest):
|
||||||
BACKEND = 'popolemploi'
|
BACKEND = 'popolemploi'
|
||||||
|
|
||||||
def test_popolemploi(self):
|
def test_popolemploi_search(self):
|
||||||
l = list(self.backend.search_job('infographiste'))
|
l = list(self.backend.search_job('infographiste'))
|
||||||
assert len(l)
|
assert len(l)
|
||||||
advert = self.backend.get_job_advert(l[0].id, l[0])
|
advert = self.backend.get_job_advert(l[0].id, l[0])
|
||||||
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
self.assertTrue(advert.url, 'URL for announce "%s" not found: %s' % (advert.id, advert.url))
|
||||||
|
|
||||||
|
def test_popolemploi_advanced_search(self):
|
||||||
|
l = list(self.backend.iter_resources([], []))
|
||||||
|
assert len(l)
|
||||||
|
advert = self.backend.get_job_advert(l[0].id, l[0])
|
||||||
|
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