mirror of
https://github.com/EDCD/EDDN.git
synced 2025-04-27 21:52:14 +03:00
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.
21 lines
352 B
Python
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()}')
|
|
|