mirror of
https://github.com/projecthorus/sondehub-infra.git
synced 2024-12-24 15:26:42 +00:00
fix tests
This commit is contained in:
parent
3582385eb3
commit
5ec656bd0d
@ -22,7 +22,6 @@ import config_handler
|
|||||||
logs = boto3.client('logs')
|
logs = boto3.client('logs')
|
||||||
sequenceToken = None
|
sequenceToken = None
|
||||||
|
|
||||||
TOPIC = config_handler.get("SNS","TOPIC")
|
|
||||||
|
|
||||||
def set_connection_header(request, operation_name, **kwargs):
|
def set_connection_header(request, operation_name, **kwargs):
|
||||||
request.headers['Connection'] = 'keep-alive'
|
request.headers['Connection'] = 'keep-alive'
|
||||||
@ -370,7 +369,7 @@ def post(payload):
|
|||||||
f.write(json.dumps(payload).encode('utf-8'))
|
f.write(json.dumps(payload).encode('utf-8'))
|
||||||
payload = base64.b64encode(compressed.getvalue()).decode("utf-8")
|
payload = base64.b64encode(compressed.getvalue()).decode("utf-8")
|
||||||
sns.publish(
|
sns.publish(
|
||||||
TopicArn=TOPIC,
|
TopicArn=config_handler.get("SNS","TOPIC"),
|
||||||
Message=payload
|
Message=payload
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
from . import *
|
from . import *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
@ -16,6 +17,9 @@ import uuid
|
|||||||
import datetime
|
import datetime
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
config_handler.get = MagicMock(return_value="test")
|
||||||
|
config_handler.get("SNS","TOPIC")
|
||||||
|
|
||||||
example_body = [{
|
example_body = [{
|
||||||
"software_name": "SondeHubUploader",
|
"software_name": "SondeHubUploader",
|
||||||
"software_version": "1.0.0",
|
"software_version": "1.0.0",
|
||||||
|
Loading…
Reference in New Issue
Block a user