29ac711d26
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
26 lines
857 B
Python
26 lines
857 B
Python
#!/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()
|