Créa·Ka — annuaire public cross-plateforme des créateurs de contenu québécois (crea-ka.com)
Python 73.6%
HTML 13.2%
TypeScript 6%
JavaScript 4.5%
CSS 1.7%
Dockerfile 0.6%
1# ==============================================================================2# Author: Simon-Pierre Boucher <contact@spboucher.ai>3# File: tests/test_linkinbio.py4# Desc: Tests du connecteur générique link-in-bio sur fixture réelle figée —5# extraction des comptes avec signal fort (0.95)6# ==============================================================================7from pathlib import Path89from creaka.connectors.linkinbio import extract_accounts, is_supported, parse_links1011FIXTURE = (Path(__file__).parent / "fixtures" / "linktree_sample.html").read_text()121314def test_is_supported():15 assert is_supported("https://linktr.ee/nom")16 assert is_supported("https://beacons.ai/nom")17 assert not is_supported("https://exemple.com/nom")18 assert not is_supported(None)192021def test_parse_links_next_data_et_ancres():22 links = parse_links(FIXTURE)23 assert "https://www.youtube.com/@CreatriceExemple" in links24 assert "https://www.instagram.com/creatrice.exemple" in links # ancre de repli252627def test_extract_accounts_signal_fort():28 accounts = extract_accounts(FIXTURE)29 by_platform = {a.platform: a for a in accounts}30 assert by_platform["youtube"].handle == "creatriceexemple"31 assert by_platform["tiktok"].handle == "creatrice.exemple"32 assert by_platform["twitch"].handle == "creatriceexemple"33 assert by_platform["patreon"].handle == "creatriceexemple"34 assert by_platform["x"].handle == "creatrice_ex"35 assert all(a.confidence == 0.95 for a in accounts) # signal link_in_bio36 assert all(a.signal == "link_in_bio" for a in accounts)37 # la boutique (site marchand) et le reel (page générique) ne sont PAS des comptes38 assert "site-web" not in by_platform or "boutique" not in \39 by_platform.get("site-web").handle40