launchmaxxing/tests/test_report.py
caelum0x 99d4f4f2ad feat: v2 -- SQLite history, submission tracking, launch-copy generator, outreach pipeline, UTM builder, status dashboard, launch report
Genuine v2 pass (not a cosmetic bump), grounded in a fresh competitive
landscape pass (Product Hunt alternatives, what's actually current in
2026, real founder pain points around launch checklists and outreach):

- launchmaxxing.db: local SQLite history layer (submission events,
  outreach contacts, content drafts, UTM links) alongside the existing
  JSON current-status state file. Still zero signup, zero server.
- submit: new primary command for directory submissions with full
  history (submit --history); platform-status kept as a working
  deprecated alias.
- content: local, template-based launch-copy generator for Product Hunt
  (tagline/description, limits enforced, hype words flagged), Show HN
  (real title format, hype stripped, 80-char limit), X/Twitter thread,
  Reddit post, LinkedIn post. No LLM call, no API key, deterministic.
- outreach: local creator/press/community/user contact pipeline plus
  per-channel cold-message drafts.
- utm: local UTM link builder with per-directory source/medium defaults,
  saved locally for whatever analytics you already run.
- track: cross-cutting status dashboard (directories/checklist/outreach/
  content) with stale/overdue reminders.
- report: shareable one-page Markdown launch summary.
- catalog: grew from 18 to 24 directories after verifying 6 new 2026
  entries live (PeerPush, Turbo0, Smol Launch, StartupBase, Microlaunch,
  Findly Tools); new ai_discovery category for AI-assistant-optimized
  listings like PeerPush.

173/173 tests passing, 98% coverage (up from 67/67 at 94%). Ruff-clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-18 14:37:01 +03:00

61 lines
2.1 KiB
Python

from __future__ import annotations
from launchmaxxing import report
def _dashboard(**overrides: object) -> dict:
base = {
"product_name": "Acme",
"created_at": "2026-10-01T00:00:00+00:00",
"age_days": 17,
"directories": {"total": 24, "submitted_or_live": 3, "not_started": 21,
"stale": [{"id": "betalist", "name": "BetaList", "url": "https://betalist.com/submit"}]},
"checklist": {"done": 2, "total": 10},
"outreach": {"total": 2, "by_status": {"contacted": 1, "replied": 1},
"stale_followups": [{"id": "abc", "name": "Jane", "channel": "creator"}]},
"content_drafts": 3,
"utm_links": 1,
"stale_days": 5,
}
base.update(overrides)
return base
def test_render_markdown_includes_product_name_and_sections() -> None:
markdown = report.render_markdown(_dashboard())
assert "# Launch report: Acme" in markdown
assert "## Directories" in markdown
assert "## Checklist" in markdown
assert "## Outreach" in markdown
assert "## Content drafted" in markdown
assert "## UTM links generated" in markdown
def test_render_markdown_lists_stale_directories() -> None:
markdown = report.render_markdown(_dashboard())
assert "BetaList" in markdown
assert "overdue" in markdown.lower()
def test_render_markdown_lists_stale_outreach_followups() -> None:
markdown = report.render_markdown(_dashboard())
assert "Jane" in markdown
assert "awaiting follow-up" in markdown.lower()
def test_render_markdown_handles_no_outreach_contacts() -> None:
dashboard = _dashboard(outreach={"total": 0, "by_status": {}, "stale_followups": []})
markdown = report.render_markdown(dashboard)
assert "No contacts tracked yet" in markdown
def test_render_markdown_omits_age_line_when_none() -> None:
dashboard = _dashboard(age_days=None)
markdown = report.render_markdown(dashboard)
assert "Launch tracking started" not in markdown
def test_render_markdown_mentions_local_only_in_footer() -> None:
markdown = report.render_markdown(_dashboard())
assert "no data leaves your machine" in markdown.lower()