elemes/services/tests
a2nr bb8ca50650 fix(upload): review — CSP SVG, boundary 5 MiB, regression guard 502/413
Hasil review pasca-fix upload asset:

Keamanan:
- Mitigasi stored-XSS via SVG (route /assets/* publik, same-origin):
  CSP 'default-src none; sandbox' saat serve SVG — di backend
  (send_assets) DAN di proxy SvelteKit (proxy hanya meneruskan
  content-type/set-cookie, jadi CSP backend tak sampai ke browser).
- Deteksi 413 proxy kini ber-test status code + pesan.

Testing:
- Regression guard: error jaringan biasa tetap 502, bukan 413.
- 413 via status code saja (tanpa regex pesan) tetap 413.
- Boundary 5 MiB: file TEPAT 5 MiB lolos; 5 MiB+1 ditolak (cabang
  len(raw) — SVG dipakai karena dikecualikan validasi PIL).
- CSP: SVG dapat header, raster tidak.
- E2E script (verify_asset_upload.py) memakai file asli
  mr-edu/assets/ilustrasi_beban.jpeg + test 413 terintegrasi.

Reuseability:
- Komentar silang-referensi _MAX_ASSET_BYTES (sumber) dengan pesan 413
  proxy dan BODY_SIZE_LIMIT compose.
2026-10-03 08:06:29 +07:00
..
fixtures
…
__init__.py
…
conftest.py feat(content-editor): konfirmasi ganda file navigasi kritis & hapus narrow sidebar 2026-08-23 08:18:02 +07:00
test_auth_routes.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_compile_sessions.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_composite_flow.py refactor(routes): remove /api/lesson-progress aliases and standardize tests to /lesson-progress 2026-08-30 04:45:37 +07:00
test_composite_score.py feat: unified lesson progress — composite score & /api/lesson-progress 2026-08-29 00:22:10 +07:00
test_content_editor_routes.py fix(upload): review — CSP SVG, boundary 5 MiB, regression guard 502/413 2026-10-03 08:06:29 +07:00
test_lesson_progress_routes.py fix(quiz): enforce 75% passing threshold, sync server progress, and persist attempt review 2026-09-09 07:33:52 +07:00
test_lesson_registry.py fix(review): address code review findings for dev to master merge 2026-09-06 18:08:58 +07:00
test_lesson_service_embed.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_lesson_service_quiz.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_lesson_service_velxio.py test(velxio): add comprehensive unit test suites for velxio-manager, hooks redirect, and backend markdown parsing 2026-09-05 18:06:19 +07:00
test_models.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_prerequisite_logic.py feat: unified lesson progress — composite score & /api/lesson-progress 2026-08-29 00:22:10 +07:00
test_progress_routes.py feat(teacher): refactor progress into tree view and separate classroom management 2026-09-15 04:51:35 +07:00
test_quiz_hash_in_code_fence.py fix(quiz): jangan belah soal saat '#' muncul di dalam code fence 2026-08-30 10:55:06 +07:00
test_repositories.py feat(student-management): sync imported progress with composite model and add inline expected format to CSV headers 2026-09-08 19:01:33 +07:00
test_student_management_routes.py feat(student-management): sync imported progress with composite model and add inline expected format to CSV headers 2026-09-08 19:01:33 +07:00
test_student_roundtrip.py feat(student-management): sync imported progress with composite model and add inline expected format to CSV headers 2026-09-08 19:01:33 +07:00
test_sub_home.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_sub_home_api.py fix(quiz): enforce 75% passing threshold, sync server progress, and persist attempt review 2026-09-09 07:33:52 +07:00
test_teacher_bootstrap.py fix(docs/api): hilangkan sync berulang di api_reference + UI API Reference di /docs 2026-08-17 16:37:30 +07:00
test_token_hashing.py refactor(test): unified test runner, markers, elemes.sh cleanup 2026-08-17 11:29:29 +07:00
test_token_service_contract.py feat: unified lesson progress — composite score & /api/lesson-progress 2026-08-29 00:22:10 +07:00