update block

This commit is contained in:
2026-01-19 13:36:37 -03:00
parent 6b472110e2
commit 3fd7c77469
16 changed files with 421 additions and 133 deletions

View File

@@ -1,22 +0,0 @@
from http import HTTPMethod, HTTPStatus
from layercake.dynamodb import DynamoDBPersistenceLayer
from ...conftest import HttpApiProxy, LambdaContext
def test_address(
app,
seeds,
http_api_proxy: HttpApiProxy,
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
lambda_context: LambdaContext,
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/orgs/cJtK9SsnJhKPyxESe7g3DG/address',
method=HTTPMethod.GET,
),
lambda_context,
)
assert r['statusCode'] == HTTPStatus.OK

View File

@@ -5,6 +5,22 @@ from layercake.dynamodb import DynamoDBPersistenceLayer
from ...conftest import HttpApiProxy, LambdaContext
def test_get_scheduled(
app,
seeds,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/orgs/cJtK9SsnJhKPyxESe7g3DG/enrollments/scheduled',
method=HTTPMethod.GET,
),
lambda_context,
)
assert r['statusCode'] == HTTPStatus.OK
def test_scheduled_proceed(
app,
seeds,

View File

@@ -17,7 +17,7 @@ def test_subscription(
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/orgs/2a8963fc-4694-4fe2-953a-316d1b10f1f5',
raw_path='/orgs/e63a579a-4719-4d64-816f-f1650ca73753',
method=HTTPMethod.GET,
),
lambda_context,
@@ -32,13 +32,13 @@ def test_add_subscription(
dynamodb_persistence_layer: DynamoDBPersistenceLayer,
lambda_context: LambdaContext,
):
org_id = 'f6000f79-6e5c-49a0-952f-3bda330ef278'
org_id = 'e63a579a-4719-4d64-816f-f1650ca73753'
r = app.lambda_handler(
http_api_proxy(
raw_path=f'/orgs/{org_id}/subscription',
method=HTTPMethod.POST,
body={
'name': 'Banco do Brasil',
'name': 'pytest subscribed',
'billing_day': 1,
'payment_method': 'MANUAL',
},
@@ -55,4 +55,4 @@ def test_add_subscription(
assert r['metadata']['billing_day'] == 1
assert r['metadata']['payment_method'] == 'MANUAL'
assert r['subscription']['name'] == 'Banco do Brasil'
assert r['subscription']['name'] == 'pytest subscribed'

View File

@@ -15,14 +15,15 @@ def test_get_org(
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/orgs/2a8963fc-4694-4fe2-953a-316d1b10f1f5',
raw_path='/orgs/7362ce9e-9dad-4483-a28b-fff4034a17a5',
method=HTTPMethod.GET,
),
lambda_context,
)
body = json.loads(r['body'])
assert 'subscription_freeze' in body
assert 'address' in body
assert 'subscription_frozen' in body
def test_add_org(
@@ -93,19 +94,3 @@ def test_revoke(
lambda_context,
)
assert r['statusCode'] == HTTPStatus.NO_CONTENT
def test_get_scheduled(
app,
seeds,
http_api_proxy: HttpApiProxy,
lambda_context: LambdaContext,
):
r = app.lambda_handler(
http_api_proxy(
raw_path='/orgs/1234/enrollments/scheduled',
method=HTTPMethod.GET,
),
lambda_context,
)
assert r['statusCode'] == HTTPStatus.OK