Пример #1
0
def test_put_money(client):
    response = create_account(client)
    account_id = response.json()['account_id']

    response = refill_deposit(client, account_id, 250)
    assert response.status_code == 200
    assert response.json()['amount'] == 250
Пример #2
0
def test_transfer_money_neg(client):
    response = create_account(client)
    account_id = response.json()['account_id']

    response = create_account(client)
    account_to = response.json()['account_id']

    refill_deposit(client, account_id, 250)

    response = client.patch("/billing/transfer_money",
                            json={
                                'source': account_id,
                                'destination': account_to,
                                'amount': 300
                            })

    assert response.status_code == 400
Пример #3
0
def test_put_negative_money(client):
    response = create_account(client)
    account_id = response.json()['account_id']

    response = refill_deposit(client, account_id, -250)
    assert response.status_code == 422
Пример #4
0
def test_put_money_to_non_exist_account(client):
    response = refill_deposit(client, str(uuid.uuid4()), 250)
    assert response.status_code == 400
Пример #5
0
def test_put_money_bad_request(client):
    response = refill_deposit(client, '', 250)
    assert response.status_code == 422