Skip to content

Commit

Permalink
Test case to disable base64 strategies via API
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Sep 27, 2022
1 parent 6c491ee commit e668bf7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/rpc/test_rpc_apiserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,10 @@ def test_api_strategy(botclient):
rc = client_get(client, f"{BASE_URI}/strategy/NoStrat")
assert_response(rc, 404)

# Disallow base64 strategies
rc = client_get(client, f"{BASE_URI}/strategy/xx:cHJpbnQoImhlbGxvIHdvcmxkIik=")
assert_response(rc, 500)


def test_list_available_pairs(botclient):
ftbot, client = botclient
Expand Down Expand Up @@ -1650,6 +1654,11 @@ def test_api_backtesting(botclient, mocker, fee, caplog, tmpdir):
assert not result['running']
assert result['status_msg'] == 'Backtest reset'

# Disallow base64 strategies
data['strategy'] = "xx:cHJpbnQoImhlbGxvIHdvcmxkIik="
rc = client_post(client, f"{BASE_URI}/backtest", data=json.dumps(data))
assert_response(rc, 500)


def test_api_backtest_history(botclient, mocker, testdatadir):
ftbot, client = botclient
Expand Down

0 comments on commit e668bf7

Please sign in to comment.