working on initial lambda support
This commit is contained in:
0
freqtrade/tests/aws/__init__.py
Normal file
0
freqtrade/tests/aws/__init__.py
Normal file
7
freqtrade/tests/aws/test_backtest.py
Normal file
7
freqtrade/tests/aws/test_backtest.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from freqtrade.aws.backtesting_lambda import backtest
|
||||
|
||||
|
||||
def test_backtest(lambda_context):
|
||||
backtest({}, {})
|
||||
@@ -15,6 +15,10 @@ from freqtrade.analyze import Analyze
|
||||
from freqtrade import constants
|
||||
from freqtrade.freqtradebot import FreqtradeBot
|
||||
|
||||
import moto
|
||||
import boto3
|
||||
import os
|
||||
|
||||
logging.getLogger('').setLevel(logging.INFO)
|
||||
|
||||
|
||||
@@ -585,3 +589,34 @@ def buy_order_fee():
|
||||
'status': 'closed',
|
||||
'fee': None
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def lambda_context():
|
||||
|
||||
# mock the different AWS features we need
|
||||
sns = moto.mock_sns()
|
||||
sns.start()
|
||||
|
||||
dynamo = moto.mock_dynamodb2()
|
||||
dynamo.start()
|
||||
|
||||
lamb = moto.mock_lambda()
|
||||
lamb.start()
|
||||
|
||||
session = boto3.session.Session()
|
||||
|
||||
client = session.client('sns')
|
||||
|
||||
os.environ["topic"] = "UnitTestTopic"
|
||||
os.environ["trackingTable"] = "UnitTrackingTable"
|
||||
os.environ["acquisitionTable"] = "UnitAcquisitionTable"
|
||||
os.environ["resultTable"] = "UnitResultTable"
|
||||
|
||||
dynamodb = boto3.resource('dynamodb')
|
||||
|
||||
# here we will define required tables later
|
||||
yield
|
||||
sns.stop()
|
||||
dynamo.stop()
|
||||
lamb.stop()
|
||||
|
||||
Reference in New Issue
Block a user