From dbda64b551aaeffa4f01779a52c7ec68b1fffa98 Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Tue, 19 Dec 2023 17:44:32 -0800 Subject: [PATCH 1/1] Move HTML test data out to separate file --- testdata/this-is-glowfic.html | 19 +++++++++++++++++++ testing/fakeserver.py | 21 ++------------------- 2 files changed, 21 insertions(+), 19 deletions(-) create mode 100644 testdata/this-is-glowfic.html diff --git a/testdata/this-is-glowfic.html b/testdata/this-is-glowfic.html new file mode 100644 index 0000000..22c7a37 --- /dev/null +++ b/testdata/this-is-glowfic.html @@ -0,0 +1,19 @@ + + +
+
We don't want edit boxes
+ This is glowfic + +
+
+
+
We don't want edit boxes
+ You sure? + +
+
+ Pretty sure. +
+
+ + diff --git a/testing/fakeserver.py b/testing/fakeserver.py index 2ed8149..bbeb522 100644 --- a/testing/fakeserver.py +++ b/testing/fakeserver.py @@ -16,25 +16,8 @@ class FakeGlowficHTTPRequestHandler(BaseHTTPRequestHandler): return 200 def do_GET(self) -> None: - body = b''' - -
-
We don't want edit boxes
- This is glowfic - -
-
-
-
We don't want edit boxes
- You sure? - -
-
- Pretty sure. -
-
- -''' + 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))) -- 2.44.1