mirror of
https://github.com/guezoloic/millesima-ai-engine.git
synced 2026-03-28 18:03:47 +00:00
ajout de la fonction informations
This commit is contained in:
15
main.py
15
main.py
@@ -171,6 +171,21 @@ class _ScraperData:
|
|||||||
def getdata(self) -> dict[str, object]:
|
def getdata(self) -> dict[str, object]:
|
||||||
return self._data
|
return self._data
|
||||||
|
|
||||||
|
def informations(self) -> str:
|
||||||
|
"""
|
||||||
|
Retourne toutes les informations sous la forme :
|
||||||
|
"Appelation,Parker,J.Robinson,J.Suckling,Prix"
|
||||||
|
"""
|
||||||
|
|
||||||
|
appellation = self.appellation()
|
||||||
|
parker = self.parker()
|
||||||
|
robinson = self.robinson()
|
||||||
|
suckling = self.suckling()
|
||||||
|
prix = self.prix()
|
||||||
|
|
||||||
|
return f"{appellation},{parker},{robinson},{suckling},{prix}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Scraper:
|
class Scraper:
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -240,3 +240,7 @@ def test_prix(scraper: Scraper):
|
|||||||
|
|
||||||
assert contenu.prix() == 65.0
|
assert contenu.prix() == 65.0
|
||||||
|
|
||||||
|
def test_informations(scraper: Scraper):
|
||||||
|
contenu = scraper.getjsondata("nino-negri-5-stelle-sfursat-2022.html")
|
||||||
|
assert contenu.informations() == "Sforzato di Valtellina,91,17,93.5,65.0"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user