Skip to content

Commit

Permalink
Merge pull request #53 from KOSASIH/deepsource-transform-3dcb79ec
Browse files Browse the repository at this point in the history
style: format code with Autopep8, Black, ClangFormat, dotnet-format, Go fmt, Gofumpt, Google Java Format, isort, Ktlint, PHP CS Fixer, Prettier, RuboCop, Ruff Formatter, Rustfmt, Scalafmt, StandardJS, StandardRB, swift-format and Yapf
  • Loading branch information
KOSASIH authored May 10, 2024
2 parents 3ea6711 + f98f08c commit 3a66e61
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tests/integration_tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@
import pytest
import requests


@pytest.fixture
def api_url():
return "https://pi-nexus-autonomous-banking-network.com/api"


@pytest.fixture
def auth_token():
# Authenticate and retrieve token
response = requests.post(f"{api_url}/auth", json={"username": "test_user", "password": "test_password"})
response = requests.post(
f"{api_url}/auth", json={"username": "test_user", "password": "test_password"}
)
return response.json()["token"]


def test_get_accounts(api_url, auth_token):
# Test GET /accounts endpoint
headers = {"Authorization": f"Bearer {auth_token}"}
response = requests.get(f"{api_url}/accounts", headers=headers)
assert response.status_code == 200
assert len(response.json()["accounts"]) > 0


def test_create_account(api_url, auth_token):
# Test POST /accounts endpoint
headers = {"Authorization": f"Bearer {auth_token}"}
Expand All @@ -27,6 +33,7 @@ def test_create_account(api_url, auth_token):
assert response.status_code == 201
assert response.json()["account_id"] is not None


def test_transfer_funds(api_url, auth_token):
# Test POST /transfers endpoint
headers = {"Authorization": f"Bearer {auth_token}"}
Expand Down

0 comments on commit 3a66e61

Please sign in to comment.