create test-run script
This commit is contained in:
36
slack-bot/traffic-scraper/prd/test-run.py
Normal file
36
slack-bot/traffic-scraper/prd/test-run.py
Normal file
@@ -0,0 +1,36 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.append(os.getcwd())
|
||||
from getTrafficInfo import getTrafficInfo
|
||||
from sendToSQS import sendToSQS
|
||||
from receiveFromSQS import receiveFromSQS
|
||||
|
||||
inst = (
|
||||
getTrafficInfo.getTrafficURL('M62')
|
||||
.findIncidents()
|
||||
.getIncidentInformation()
|
||||
.generateOutput()
|
||||
)
|
||||
|
||||
instSend = sendToSQS.createSession(
|
||||
profileName='plex-aws',
|
||||
queueURL='https://sqs.eu-west-1.amazonaws.com'
|
||||
'/745437999005/slack-bot.fifo',
|
||||
)
|
||||
|
||||
for item in instSend.output:
|
||||
inst.sendMessage(message=item, messageGroupId='slack-bot-M62')
|
||||
|
||||
instReceive = receiveFromSQS(
|
||||
instSend.session,
|
||||
queueURL='https://sqs.eu-west-1.amazonaws.com/745437999005'
|
||||
'/slack-bot.fifo',
|
||||
)
|
||||
|
||||
output = instReceive.receiveNMessages(numberOfMessages=4).generateOutput(
|
||||
type='json'
|
||||
)
|
||||
instReceive.savetoDisk(
|
||||
f'{os.getcwd()}'
|
||||
)
|
||||
Reference in New Issue
Block a user