mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-11-01 18:52:21 +01:00
On native Windows the default text encoding is the ANSI code page (cp1252 on en/pt systems), so the module-level read_text() calls in eight static tests fail at collection with UnicodeDecodeError on bytes 0x81/0x90 that appear in static/js/chat.js, chatRenderer.js, app.js, index.html and src/visual_report.py. Pass encoding="utf-8" like the other 700+ tests in the suite already do. Found by running the suite natively on Windows 11 (Python 3.11). Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Alexandre Teixeira <general@alexandreteixeira.dev>
47 lines
2.0 KiB
Python
47 lines
2.0 KiB
Python
from pathlib import Path
|
|
import re
|
|
from tests.helpers.stylesheets import app_css
|
|
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
CHAT = (ROOT / "static/js/chat.js").read_text(encoding="utf-8")
|
|
RENDERER = (ROOT / "static/js/chatRenderer.js").read_text(encoding="utf-8")
|
|
STYLE = app_css()
|
|
APP = (ROOT / "static/app.js").read_text(encoding="utf-8")
|
|
INDEX = (ROOT / "static/index.html").read_text(encoding="utf-8")
|
|
|
|
|
|
def test_live_interruption_controls_have_visible_resume_labels():
|
|
assert CHAT.count('continueBtn.innerHTML = \'<span class="resume-btn-label">Resume</span>') == 2
|
|
assert "_cont.innerHTML = '<span class=\"resume-btn-label\">Resume</span>" in CHAT
|
|
|
|
|
|
def test_restored_interruption_control_has_visible_resume_label():
|
|
assert "continueBtn.className = 'continue-btn resume-btn';" in RENDERER
|
|
assert 'continueBtn.innerHTML = \'<span class="resume-btn-label">Resume</span>' in RENDERER
|
|
|
|
|
|
def test_resume_label_uses_scoped_compact_button_styling():
|
|
assert ".continue-btn.resume-btn {" in STYLE
|
|
assert "display:inline-flex;" in STYLE
|
|
resume_start = STYLE.index(".continue-btn.resume-btn {")
|
|
resume_block = STYLE[resume_start:STYLE.index(" }", resume_start) + len(" }")]
|
|
assert "border:none;" in resume_block
|
|
assert "top:2px;" in resume_block
|
|
assert ".continue-btn.resume-btn .resume-btn-icon" in STYLE
|
|
|
|
|
|
def test_resume_uses_control_message_instead_of_copying_partial_output():
|
|
assert CHAT.count("msgInput.value = 'Continue from where you left off.';") == 2
|
|
assert "cutoff.slice(-500)" not in CHAT
|
|
assert "msgInput.value = 'Continue from where you left off.';" in RENDERER
|
|
assert "cutoff.slice(-500)" not in RENDERER
|
|
|
|
|
|
def test_chat_controller_uses_one_module_identity():
|
|
app_version = re.search(r"\./js/chat\.js\?v=([A-Za-z0-9_-]+)", APP)
|
|
index_versions = re.findall(r"/static/js/chat\.js\?v=([A-Za-z0-9_-]+)", INDEX)
|
|
assert app_version
|
|
assert len(index_versions) == 2
|
|
assert set(index_versions) == {app_version.group(1)}
|