HtmlPropertyExtractorTest

43

tests

0

failures

0

ignored

0.023s

duration

100%

successful

Tests

Test Duration Result
extract does not reject SeLoger without blob even when url has an id() 0s passed
extract does not reject when blob exposes no id (soft degrade)() 0s passed
extract does not reject when url has no parsable listing-id (soft degrade)() 0.001s passed
extract falls back to title when json ld missing() 0s passed
extract ignores json ld with unrecognized listing type instead of corrupting type field (AND-4)() 0s passed
extract keeps data when blob ad id matches url listing-id (MATCH — unchanged)() 0s passed
extract recovers ParuVendu address and diagnostics from description block() 0.007s passed
extract recovers core fields from PAP json ld() 0s passed
extract recovers core fields from SeLoger json ld typed RealEstateListing (AND-4)() 0.001s passed
extract recovers datePosted from schema-org json ld (SeLoger-LeBonCoin style)() 0s passed
extract rejects data when blob ad id differs from url listing-id (MISMATCH)() 0.002s passed
extract surfaces blob fields (etageMax, ges) end-to-end when markdown-less() 0.001s passed
extract surfaces etageMax from Etage N over M when no blob() 0s passed
extractAdListingId reads list_id then falls back to id() 0s passed
extractAnneeConstruction parses common phrasings() 0s passed
extractAnneeConstruction rejects out-of-range years() 0s passed
extractAnneeRenovation distinguishes from construction() 0.001s passed
extractAnneeRenovation parses common variants() 0s passed
extractEtage handles RDC variants() 0.001s passed
extractEtage parses common patterns() 0.001s passed
extractEtage returns null when no floor info() 0s passed
extractEtageRatio parses Etage N over M() 0s passed
extractEtageRatio parses RDC over M as floor zero() 0.001s passed
extractEtageRatio rejects implausible etage greater than etageMax() 0s passed
extractEtageRatio returns nulls when absent() 0s passed
extractFromNextData is defensive against malformed json() 0.001s passed
extractFromNextData reads structured attributes from the LBC blob() 0s passed
extractFromNextData returns empty when no blob present() 0s passed
extractImageUrls falls back to img tags and srcset() 0s passed
extractImageUrls falls back to og image only when no json ld() 0s passed
extractImageUrls filters out logos icons trackers and svg() 0s passed
extractImageUrls keeps only dominant host (drops interlaced agency banners)() 0.001s passed
extractImageUrls reads json ld ImageObject url (tier 1 wins over noisy img tags)() 0s passed
extractImageUrls reads json ld image array (SeLoger-like)() 0s passed
extractImageUrls returns empty on blank or imageless html() 0.002s passed
extractNbChambres detects explicit mentions() 0s passed
extractNbChambres returns null without explicit count() 0s passed
extractNbLotsCopro detects copro size mentions() 0s passed
extractNbLotsCopro rejects implausible counts() 0s passed
extractNomResidence captures named residences() 0.001s passed
extractNomResidence returns null when no residence prefix() 0s passed
parseRequestedListingId parses LBC and SeLoger formats() 0.001s passed
parseRequestedListingId returns null for unrecognised or blank urls() 0.001s passed

Standard output

20:41:20.271 [Test worker] WARN com.alertimmo.aiscraping.extraction.HtmlPropertyExtractor -- [HtmlPropertyExtractor] listing-id mismatch — blob ad.id=33333 != url id=3195934865 (https://www.leboncoin.fr/ad/ventes_immobilieres/3195934865). Rejet des données HTML pour éviter de servir le prix d'un autre bien.
20:41:20.275 [Test worker] WARN com.alertimmo.aiscraping.extraction.HtmlPropertyExtractor -- [HtmlPropertyExtractor] __NEXT_DATA__ present (15 chars) but unparseable: Unexpected character ('n' (code 110)): was expecting double-quote to start field name
 at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]