tests: add tests for build-dir

This commit is contained in:
Jose Diaz-Gonzalez
2021-07-10 00:49:36 -04:00
parent 2580ad305c
commit d4016223d5
5 changed files with 74 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
web: python3 web.py
release: python3 release.py

View File

View File

@@ -0,0 +1,10 @@
#!/usr/bin/env python
import os
def main():
print("SECRET_KEYS: {0}".format(os.getenv('SECRET_KEY')))
if __name__ == '__main__':
main()

View File

@@ -0,0 +1,23 @@
import http.server
import json
import os
class GetHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-Type", "text/plain; charset=utf-8")
self.end_headers()
if self.path == '/':
self.wfile.write("python/http.server".encode("utf-8"))
else:
data = json.dumps(dict(os.environ), sort_keys=True, indent=4)
self.wfile.write(data.encode("utf-8"))
if __name__ == "__main__":
port = int(os.getenv("PORT", 5000))
server = http.server.HTTPServer(("0.0.0.0", port), GetHandler)
print("Listening on port {0}".format(port))
server.serve_forever()