Test forcebuy - cleanup some tests

This commit is contained in:
Matthias
2019-05-15 06:51:23 +02:00
parent 350c903793
commit b700c64dc2
2 changed files with 68 additions and 5 deletions

View File

@@ -314,7 +314,10 @@ class ApiServer(RPC):
asset = request.json.get("pair")
price = request.json.get("price", None)
trade = self._rpc_forcebuy(asset, price)
return self.rest_dump(trade.to_json())
if trade:
return self.rest_dump(trade.to_json())
else:
return self.rest_dump({"status": f"Error buying pair {asset}."})
@safe_rpc
def _forcesell(self):