28 lines
686 B
Python
28 lines
686 B
Python
def test_placing_an_order(client):
|
|
response = client.post(
|
|
"/orders",
|
|
json={
|
|
"type": "limit",
|
|
"instrument": "US0378331005",
|
|
"limit_price": 100.00,
|
|
"quantity": 10,
|
|
"side": "buy",
|
|
},
|
|
)
|
|
|
|
assert response.status_code == 201 or response.status_code == 500
|
|
|
|
|
|
def test_create_order_with_invalid_request(client):
|
|
response = client.post(
|
|
"/orders",
|
|
json={
|
|
"type": "unknown_type",
|
|
"instrument": "US0378331005",
|
|
"limit_price": 100.00,
|
|
"quantity": 10,
|
|
"side": "buy",
|
|
},
|
|
)
|
|
assert response.status_code == 422
|