This commit is contained in:
Ole
2026-05-16 06:54:17 +00:00
commit 1399f61c1a
44 changed files with 6746 additions and 0 deletions
+236
View File
@@ -0,0 +1,236 @@
"""Fixture data for testing without hitting live APIs."""
# noqa: E501
SAMPLE_FINN_SEARCH_HTML = """
<!DOCTYPE html>
<html lang="no">
<head><title>FINN.no - Leiligheter til salgs</title></head>
<body>
<div class="listings">
<article class="listing-card" data-id="462400360">
<a href="https://www.finn.no/realestate/homes/ad.html?finnkode=462400360" class="listing-link">
<div class="title">Flott 3-roms i Ferner</div>
<div class="meta">
<span class="area">77 m²</span>
<span class="price">7 200 991 kr</span>
<span class="price-per-sqm">93 500 kr/m²</span>
</div>
</a>
<div class="details">
<span class="bedrooms">3</span>
<span class="location">Grünerløkka, Oslo</span>
<span class="common-costs">3 500 kr/mnd</span>
</div>
</article>
<article class="listing-card" data-id="460784945">
<a href="https://www.finn.no/realestate/homes/ad.html?finnkode=460784945" class="listing-link">
<div class="title">Leilighet med potensial - må renoveres</div>
<div class="meta">
<span class="area">65 m²</span>
<span class="price">6 500 000 kr</span>
<span class="price-per-sqm">100 000 kr/m²</span>
</div>
</a>
<div class="details">
<span class="bedrooms">2</span>
<span class="location">Sagene, Oslo</span>
<span class="common-costs">2 800 kr/mnd</span>
</div>
</article>
</div>
</body>
</html>
"""
# noqa: E501
SAMPLE_FINN_SEARCH_HTML_NEW = """
<!DOCTYPE html>
<html lang="no">
<head><title>FINN.no - Leiligheter til salgs</title></head>
<body>
<div class="listings">
<article class="relative isolate sf-search-ad card card--cardShadow">
<div class="col-span-2 p-16 grid sm:grid-cols-2">
<h2 class="h4 mb-0 col-span-2 mt-12 sm:mt-24 sf-realestate-heading">IDYLLISKE ILADALEN - Lekker 3-roms loftsleilighet fra 2016 | Privat, solrik takterrasse | Peis | Gulvareal på 77kvm | Sentralt, men rolig</h2>
<a href="https://www.finn.no/realestate/homes/ad.html?finnkode=462880791" class="sf-search-ad-link s-text!">IDYLLISKE ILADALEN - Lekker 3-roms loftsleilighet fra 2016 | Privat, solrik takterrasse | Peis | Gulvareal på 77kvm | Sentralt, men rolig</a>
<div class="mt-4 sf-line-clamp-2 sm:order-first sm:text-right sm:mt-0 sm:ml-16 sf-realestate-location">Lofotgata 4B, Oslo</div>
<div class="col-span-2 mt-16 flex justify-between sm:mt-4 sm:block space-x-12 font-bold">62 m² 6 750 000 kr</div>
<div class="col-span-2 sm:flex sm:items-baseline sm:justify-between">Totalpris: 7 253 377 kr ∙ Fellesutg.: 7 067 kr ∙ Andel ∙ Leilighet ∙ 2 soverom</div>
</div>
</article>
</div>
</body>
</html>
"""
SAMPLE_FINN_LISTING_HTML = """
<!DOCTYPE html>
<html lang="no">
<head><title>Flott 3-roms i Ferner - FINN.no</title></head>
<body>
<div class="listing-details">
<div class="heading">
<h1>Flott 3-roms i Ferner</h1>
<div class="price">Totalpris: 7 200 991 kr</div>
</div>
<div class="properties">
<dl>
<dt>Adresse</dt>
<dd>Fernerveien 42, 0554 Oslo</dd>
<dt>Område</dt>
<dd>Grünerløkka</dd>
<dt>Postnummer</dt>
<dd>0554</dd>
<dt>Eierform</dt>
<dd>Eierbolig</dd>
<dt>Eiendomstype</dt>
<dd>Leilighet</dd>
<dt>Prisantydning</dt>
<dd>7 200 000 kr</dd>
<dt>Totalpris</dt>
<dd>7 200 991 kr</dd>
<dt>Fellesgjeld</dt>
<dd>0 kr</dd>
<dt>Felles utgifter</dt>
<dd>3 500 kr/mnd</dd>
<dt>Boligareal</dt>
<dd>77 m²</dd>
<dt>Rom</dt>
<dd>4</dd>
<dt>Soverom</dt>
<dd>3</dd>
<dt>Etasje</dt>
<dd>4. etasje</dd>
<dt>Byggeår</dt>
<dd>2005</dd>
<dt>Energimerking</dt>
<dd>C</dd>
<dt>Oppvarming</dt>
<dd>Fjernvarme</dd>
<dt>Balkonger/terrasser</dt>
<dd>Ja, balkonger</dd>
<dt>Heis</dt>
<dd>Ja</dd>
<dt>Parkering/garasje</dt>
<dd>Privat parkering</dd>
</dl>
</div>
<div class="description">
<h2>Beskrivelse</h2>
<p>Flott beliggenhet med fin utsikt over Oslo. Moderne kjøkken og bad.</p>
<p>Klar til visning!</p>
</div>
<div class="broker">
<div class="broker-info">
<span class="broker-name">Meglerhuset AS</span>
<span class="broker-contact">Telefon: 21 00 00 00</span>
</div>
</div>
</div>
</body>
</html>
"""
SAMPLE_FINN_LISTING_HTML_NEW = """
<!DOCTYPE html>
<html lang="no">
<head><title>Romslig 5-roms i 5.etasje med heisadkomst</title></head>
<body>
<div data-testid="object-details">
<h1>Romslig 5-roms i 5.etasje med heisadkomst | 2 hybler | 4 balkonger | Ingen dokavgift!</h1>
<span data-testid="object-address">Hegdehaugsveien 3, 0352 Oslo</span>
<span data-testid="local-area-name">Homansbyen</span>
<section data-testid="pricing-details">
<div data-testid="pricing-incicative-price">Prisantydning10 900 000 kr</div>
<div data-testid="pricing-total-price"><dt>Totalpris</dt><dd>10 986 901 kr</dd></div>
<div data-testid="pricing-joint-debt"><dt>Fellesgjeld</dt><dd>76 911 kr</dd></div>
<div data-testid="pricing-common-monthly-cost"><dt>Felleskost/mnd.</dt><dd>12 011 kr</dd></div>
</section>
<section data-testid="key-info">
<div data-testid="info-property-type">BoligtypeLeilighet</div>
<div data-testid="info-ownership-type">EieformAndel</div>
<div data-testid="info-bedrooms">Soverom2</div>
<div data-testid="info-rooms">Rom5</div>
<div data-testid="info-construction-year">Byggeår1938</div>
<div data-testid="info-usable-i-area">Internt bruksareal124 m² (BRA-i)</div>
</section>
<section data-testid="object-facilities">FasiliteterBalkong/TerrasseParkettHeis</section>
<section data-testid="om boligen">
<h2>Om boligen</h2>
<p>Her bor du med kort vei til daglige behov og offentlig transport.</p>
</section>
</div>
</body>
</html>
"""
SAMPLE_EIENDOM_UNIT_JSON = {
"units": [
{
"unitCode": "c-gxw-xmyum-s2a",
"address": "Fernerveien 42, 0554 Oslo",
"municipality": "Oslo",
"lat": 59.9287,
"lon": 10.7803,
"propertyType": "APARTMENT",
"floor": 4,
"rooms": 4,
"constructionYear": 2005,
"usableArea": 77,
"estimatedSellingPrice": 7650000,
"estimatedSellingPriceLower": 6900000,
"estimatedSellingPriceUpper": 8400000,
"listingPrice": 7200000,
"listingSquareMeterPrice": 93500,
"commonCosts": 3500,
"daysOnMarket": 12,
"saleStatus": "FOR_SALE",
"marketPlacementScore": "ABOVE_AVERAGE",
"similarUnitCount": 12,
"averageSquareMeterPrice": 98000,
}
]
}
SAMPLE_EIENDOM_SIMILAR_UNITS_JSON = {
"units": [
{
"unitCode": "c-recent-1",
"address": "Birketveien 10, 0554 Oslo",
"lat": 59.9290,
"lon": 10.7810,
"propertyType": "APARTMENT",
"floor": 3,
"rooms": 3,
"constructionYear": 2004,
"usableArea": 75,
"listingPrice": 7100000,
"sellingPrice": 7050000,
"sharedDebt": 0,
"commonCosts": 3400,
"squareMeterPrice": 94000,
"daysOnMarket": 18,
"saleStatus": "SOLD",
"finalizedAt": "2024-05-01",
},
{
"unitCode": "c-recent-2",
"address": "Sommers gate 5, 0554 Oslo",
"lat": 59.9280,
"lon": 10.7820,
"propertyType": "APARTMENT",
"floor": 2,
"rooms": 4,
"constructionYear": 2006,
"usableArea": 80,
"listingPrice": 7400000,
"sellingPrice": 7350000,
"sharedDebt": 0,
"commonCosts": 3600,
"squareMeterPrice": 91875,
"daysOnMarket": 22,
"saleStatus": "SOLD",
"finalizedAt": "2024-04-28",
},
]
}