tests: refactor the config test to use a simple python codebase instead

This should also make it possible to run the tests locally on an ARM machine.
This commit is contained in:
Jose Diaz-Gonzalez
2023-01-25 23:01:15 -05:00
parent a2baf37cd9
commit be682e8504
7 changed files with 46 additions and 28 deletions

View File

@@ -12,6 +12,12 @@ class GetHandler(http.server.BaseHTTPRequestHandler):
if self.path == '/':
self.wfile.write("python/http.server".encode("utf-8"))
elif self.path == '/conftest':
value = os.getenv("CONFTEST", "")
self.wfile.write(value.encode("utf-8"))
elif self.path == '/hello':
value = os.getenv("HELLO", "")
self.wfile.write(value.encode("utf-8"))
else:
data = json.dumps(dict(os.environ), sort_keys=True, indent=4)
self.wfile.write(data.encode("utf-8"))