Spaces:
Sleeping
Sleeping
Commit ·
85d27fb
1
Parent(s): c304ef4
test: finale cues assert class=cue-audio (queued) instead of autoplay
Browse files- tests/test_app.py +4 -4
- tests/test_render.py +5 -4
tests/test_app.py
CHANGED
|
@@ -172,8 +172,8 @@ class TestFinaleBuildAndConvulse:
|
|
| 172 |
assert any("entity-redpulse" in e for e in entities) # build pulse
|
| 173 |
assert any("<audio autoplay loop" in e for e in entities) # heartbeat bed
|
| 174 |
assert any("entity-convulse-soft" in e for e in entities) # soft convulse
|
| 175 |
-
# the relief sigh plays ON the settle (peace face + audio together)
|
| 176 |
-
assert any("entity-peace" in e and "
|
| 177 |
assert "entity-peace" in entities[-1] # settles happy
|
| 178 |
|
| 179 |
def test_loop_finale_builds_then_convulses_and_settles_on_end(self, monkeypatch):
|
|
@@ -181,8 +181,8 @@ class TestFinaleBuildAndConvulse:
|
|
| 181 |
entities = [o[6] for o in outs]
|
| 182 |
assert any("<audio autoplay loop" in e for e in entities) # heartbeat bed
|
| 183 |
assert any("entity-frenzy-wrap" in e for e in entities) # convulse_loop
|
| 184 |
-
# the flatline plays ON the settle (end face + audio together)
|
| 185 |
-
assert any("entity-end" in e and "
|
| 186 |
assert "entity-end" in entities[-1] # settles on end
|
| 187 |
|
| 188 |
def test_bad_finale_builds_with_heartbeat_before_the_frenzy(self, monkeypatch):
|
|
|
|
| 172 |
assert any("entity-redpulse" in e for e in entities) # build pulse
|
| 173 |
assert any("<audio autoplay loop" in e for e in entities) # heartbeat bed
|
| 174 |
assert any("entity-convulse-soft" in e for e in entities) # soft convulse
|
| 175 |
+
# the relief sigh plays ON the settle (peace face + cue audio together)
|
| 176 |
+
assert any("entity-peace" in e and "cue-audio" in e for e in entities)
|
| 177 |
assert "entity-peace" in entities[-1] # settles happy
|
| 178 |
|
| 179 |
def test_loop_finale_builds_then_convulses_and_settles_on_end(self, monkeypatch):
|
|
|
|
| 181 |
entities = [o[6] for o in outs]
|
| 182 |
assert any("<audio autoplay loop" in e for e in entities) # heartbeat bed
|
| 183 |
assert any("entity-frenzy-wrap" in e for e in entities) # convulse_loop
|
| 184 |
+
# the flatline plays ON the settle (end face + cue audio together)
|
| 185 |
+
assert any("entity-end" in e and "cue-audio" in e for e in entities)
|
| 186 |
assert "entity-end" in entities[-1] # settles on end
|
| 187 |
|
| 188 |
def test_bad_finale_builds_with_heartbeat_before_the_frenzy(self, monkeypatch):
|
tests/test_render.py
CHANGED
|
@@ -287,7 +287,7 @@ class TestEntityFrenzyMode:
|
|
| 287 |
def test_frenzy_has_triple_screen_stab_and_sting(self):
|
| 288 |
out = render_entity(12, "frenzy")
|
| 289 |
assert "entity-ghost-frenzy" in out
|
| 290 |
-
assert "
|
| 291 |
|
| 292 |
|
| 293 |
class TestReplyChime:
|
|
@@ -307,7 +307,8 @@ class TestReplyChime:
|
|
| 307 |
|
| 308 |
def test_frenzy_keeps_only_the_sting(self):
|
| 309 |
out = render_entity(12, "frenzy")
|
| 310 |
-
assert out.count("
|
|
|
|
| 311 |
|
| 312 |
|
| 313 |
class TestBuildMode:
|
|
@@ -345,9 +346,9 @@ class TestSettleModes:
|
|
| 345 |
def test_peace_settle_shows_the_smile_and_sighs(self):
|
| 346 |
html = render_entity(80, "peace_settle", seq=2)
|
| 347 |
assert "entity-peace" in html # the smile
|
| 348 |
-
assert "
|
| 349 |
|
| 350 |
def test_end_settle_shows_the_end_face_and_flatlines(self):
|
| 351 |
html = render_entity(80, "end_settle", seq=2)
|
| 352 |
assert "entity-end" in html
|
| 353 |
-
assert "
|
|
|
|
| 287 |
def test_frenzy_has_triple_screen_stab_and_sting(self):
|
| 288 |
out = render_entity(12, "frenzy")
|
| 289 |
assert "entity-ghost-frenzy" in out
|
| 290 |
+
assert "cue-audio" in out # the sting (queued)
|
| 291 |
|
| 292 |
|
| 293 |
class TestReplyChime:
|
|
|
|
| 307 |
|
| 308 |
def test_frenzy_keeps_only_the_sting(self):
|
| 309 |
out = render_entity(12, "frenzy")
|
| 310 |
+
assert out.count("cue-audio") == 1
|
| 311 |
+
assert "<audio autoplay" not in out # the sting routes via the queue
|
| 312 |
|
| 313 |
|
| 314 |
class TestBuildMode:
|
|
|
|
| 346 |
def test_peace_settle_shows_the_smile_and_sighs(self):
|
| 347 |
html = render_entity(80, "peace_settle", seq=2)
|
| 348 |
assert "entity-peace" in html # the smile
|
| 349 |
+
assert "cue-audio" in html # the relief sigh (queued)
|
| 350 |
|
| 351 |
def test_end_settle_shows_the_end_face_and_flatlines(self):
|
| 352 |
html = render_entity(80, "end_settle", seq=2)
|
| 353 |
assert "entity-end" in html
|
| 354 |
+
assert "cue-audio" in html # the flatline (queued)
|