Athanasius 2a8eb8d021
Gateway: Add test scripts and supporting files
These are what I was using on my home server to test the prior code
changes to how the Gateway code reports errors.

Ultimately these should become a part of proper tests, but for now
they're at least in the repository for anyone to utilise.
2022-01-09 16:21:23 +00:00

21 lines
352 B
Python

#!/usr/bin/env python3
import json
import requests
import sys
if len(sys.argv) != 2:
print('test-sender.py <filename>')
sys.exit(-1)
with open(sys.argv[1], 'r') as f:
msg = f.read()
s = requests.Session()
r = s.post('https://beta.eddn.edcd.io:4431/upload/', data=msg)
print(f'Response: {r!r}')
print(f'Body: {r.content.decode()}')