R-799 metube add body, R-761 logo name, R-391 no observations section (burn-down)
gates / gates (push) Successful in 2s
gates / gates (push) Successful in 2s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
7a19491898
commit
29ac711d26
8 files changed
+56
-12
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python3
|
||||
"""R-799: the MeTube fixture's POST /add body carries every field upstream's validator lists as required.
|
||||
Run: python3 scripts/test_upgrade_fixtures_metube.py"""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import upgrade_fixtures_box as u # noqa: E402
|
||||
|
||||
|
||||
class MeTubeAddBody(unittest.TestCase):
|
||||
def test_required_fields_present(self):
|
||||
b = u.MeTube.add_body()
|
||||
for k in ("url", "download_type", "quality", "format"):
|
||||
self.assertIn(k, b, "POST /add without %s" % k)
|
||||
self.assertEqual(b["download_type"], "video")
|
||||
|
||||
def test_seed_sends_add_body(self):
|
||||
src = open(u.__file__).read()
|
||||
self.assertIn("json.dumps(self.add_body())", src, "MeTube.seed no longer sends add_body()")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
@@ -2168,6 +2168,12 @@ class MeTube:
|
||||
sub = "video"
|
||||
URL = "https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/360/Big_Buck_Bunny_360_10s_1MB.mp4"
|
||||
|
||||
@classmethod
|
||||
def add_body(cls):
|
||||
"""The `POST /add` body. `download_type` is listed as REQUIRED by upstream's validator; 2026.09.28/.29 answered
|
||||
200 without it (R-799), a later tag may not. Pinned by test_upgrade_fixtures_metube.py."""
|
||||
return {"url": cls.URL, "download_type": "video", "quality": "best", "format": "any", "auto_start": True}
|
||||
|
||||
def _hist(self, w, sub):
|
||||
rc, code, out = w.app_curl(sub, "/history")
|
||||
try:
|
||||
@@ -2180,7 +2186,7 @@ class MeTube:
|
||||
self.tried = "/ never answered 200"
|
||||
return None
|
||||
rc, code, out = w.app_curl(sub, "/add", "-H", "Content-Type: application/json", "-H", f"Origin: https://{sub}.{w.DOMAIN}",
|
||||
data=json.dumps({"url": self.URL, "quality": "best", "format": "any", "auto_start": True}), method="POST")
|
||||
data=json.dumps(self.add_body()), method="POST")
|
||||
say(f" metube: POST /add http={code} {(out or '')[:40]}")
|
||||
if code != "200":
|
||||
self.tried = f"add -> {code} {(out or '')[:80]}"
|
||||
|
||||
Reference in new issue
Block a user