MAstodon posts fixed
Build LinkLog Development Image / development-image (push) Successful in 11s

This commit is contained in:
2026-08-26 09:26:16 +02:00
parent 333aab8e8a
commit 22add753fe
12 changed files with 682831 additions and 35 deletions
+5 -4
View File
@@ -4,6 +4,7 @@
import json
import threading
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.parse import parse_qs
from uuid import uuid4
from unittest.mock import patch
@@ -410,7 +411,8 @@ def test_link_submission_posts_to_enabled_mastodon_plugin():
def do_POST(self):
received['path'] = self.path
received['authorization'] = self.headers['Authorization']
received['body'] = json.loads(self.rfile.read(int(self.headers['Content-Length'])))
received['content_type'] = self.headers['Content-Type']
received['body'] = parse_qs(self.rfile.read(int(self.headers['Content-Length'])).decode())
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
@@ -442,9 +444,8 @@ def test_link_submission_posts_to_enabled_mastodon_plugin():
assert response.status_code == 201
assert received['path'] == '/api/v1/statuses'
assert received['authorization'] == 'Bearer test-token'
assert received['body'] == {
'status': 'A useful page\nWorth sharing\nFrom my #LinkLog: https://example.com/useful #python #web',
}
assert received['content_type'] == 'application/x-www-form-urlencoded'
assert received['body'] == {'status': ['A useful page\nWorth sharing\nFrom my #LinkLog: https://example.com/useful #python #web']}
finally:
server.shutdown()
thread.join()