]> git.scottworley.com Git - paperdoorknob/blobdiff - testing/fakeserver.py
image filenames: Drop ? and following query parameters
[paperdoorknob] / testing / fakeserver.py
index 2ed8149b2dfbe41dce5e9e1e9ce61af020c607ef..fbef2e537b38de344c6817192899ce80d9c697c7 100644 (file)
@@ -16,31 +16,14 @@ class FakeGlowficHTTPRequestHandler(BaseHTTPRequestHandler):
         return 200
 
     def do_GET(self) -> None:
-        body = b'''<html>
-  <body>
-    <div class="post-container post-post">
-      <div class="post-edit-box">We don't want edit boxes</div>
-      This is glowfic
-      <div class="post-footer">We don't want footers</div>
-    </div>
-    <div class="flat-post-replies">
-      <div class="post-container post-reply">
-        <div class="post-edit-box">We don't want edit boxes</div>
-        You <em>sure</em>?
-        <div class="post-footer">We don't want footers</div>
-      </div>
-      <div class="post-container post-reply">
-        Pretty sure.
-      </div>
-    </div>
-  </body>
-</html>'''
+        self._notify_server()
+        with open("testdata/this-is-glowfic.html", "rb") as f:
+            body = f.read(9999)
         self.send_response(self._response_code())
         self.send_header("Content-type", "text/html")
         self.send_header("Content-Length", str(len(body)))
         self.end_headers()
         self.wfile.write(body)
-        self._notify_server()
 
 
 class FakeGlowficServer():