Skip to content

Commit ed858ef

Browse files
committed
fix: lint
1 parent df2e11b commit ed858ef

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

tests/core/credit/test_expense.py

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
import pytest
66

7-
from intentkit.core.credit import expense_message, expense_skill, expense_summarize, skill_cost
7+
from intentkit.core.credit import (
8+
expense_skill,
9+
expense_summarize,
10+
skill_cost,
11+
)
812
from intentkit.models.agent import Agent
913
from intentkit.models.credit import CreditAccountTable, CreditType, OwnerType
1014

@@ -24,7 +28,9 @@ async def test_skill_cost_self_key_pricing():
2428
mock_skill.author = None
2529

2630
with (
27-
patch("intentkit.core.credit.expense.Skill.get", new_callable=AsyncMock) as mock_get,
31+
patch(
32+
"intentkit.core.credit.expense.Skill.get", new_callable=AsyncMock
33+
) as mock_get,
2834
patch("intentkit.config.config.config.payment_enabled", True),
2935
patch(
3036
"intentkit.models.app_setting.AppSetting.payment", new_callable=AsyncMock
@@ -49,7 +55,9 @@ async def test_skill_cost_missing_skill():
4955
agent.fee_percentage = Decimal("0")
5056
agent.skills = {}
5157

52-
with patch("intentkit.core.credit.expense.Skill.get", new_callable=AsyncMock) as mock_get:
58+
with patch(
59+
"intentkit.core.credit.expense.Skill.get", new_callable=AsyncMock
60+
) as mock_get:
5361
mock_get.return_value = None
5462
with pytest.raises(ValueError, match="price of missing"):
5563
await skill_cost("missing", "user-1", agent)
@@ -119,7 +127,10 @@ def side_effect_refresh(instance):
119127
),
120128
):
121129
mock_skill_cost.return_value = skill_cost_info
122-
mock_expense.return_value = (mock_user_account, {CreditType.PERMANENT: Decimal("5.0000")})
130+
mock_expense.return_value = (
131+
mock_user_account,
132+
{CreditType.PERMANENT: Decimal("5.0000")},
133+
)
123134

124135
result = await expense_skill(
125136
mock_session,
@@ -232,7 +243,9 @@ async def test_skill_cost_uses_author_fee_recipient():
232243
mock_skill.author = "dev-user"
233244

234245
with (
235-
patch("intentkit.core.credit.expense.Skill.get", new_callable=AsyncMock) as mock_get,
246+
patch(
247+
"intentkit.core.credit.expense.Skill.get", new_callable=AsyncMock
248+
) as mock_get,
236249
patch("intentkit.config.config.config.payment_enabled", True),
237250
patch(
238251
"intentkit.models.app_setting.AppSetting.payment", new_callable=AsyncMock

tests/core/credit/test_list_events.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
CreditEventTable,
1616
Direction,
1717
EventType,
18-
OwnerType,
1918
)
2019
from intentkit.utils.error import IntentKitAPIError
2120

@@ -33,7 +32,9 @@ def where(self, condition: object):
3332
operator = getattr(condition, "operator", None)
3433
key = getattr(left, "key", "")
3534
op = getattr(operator, "__name__", str(operator))
36-
self.conditions.append((key, op, right.value if hasattr(right, "value") else right))
35+
self.conditions.append(
36+
(key, op, right.value if hasattr(right, "value") else right)
37+
)
3738
return self
3839

3940
def order_by(self, *_args):

tests/core/credit/test_refill.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
refill_all_free_credits,
88
refill_free_credits_for_account,
99
)
10-
from intentkit.models.credit import CreditAccount, CreditAccountTable, CreditType, OwnerType
10+
from intentkit.models.credit import (
11+
CreditAccount,
12+
CreditAccountTable,
13+
CreditType,
14+
OwnerType,
15+
)
1116

1217

1318
@pytest.mark.asyncio
@@ -39,7 +44,8 @@ async def test_refill_free_credits_for_account_skips_zero_refill():
3944
mock_session = AsyncMock()
4045

4146
with patch(
42-
"intentkit.models.credit.CreditAccount.income_in_session", new_callable=AsyncMock
47+
"intentkit.models.credit.CreditAccount.income_in_session",
48+
new_callable=AsyncMock,
4349
) as mock_income:
4450
await refill_free_credits_for_account(mock_session, account)
4551

@@ -157,7 +163,8 @@ async def test_refill_all_free_credits_iterates_accounts():
157163

158164
with (
159165
patch(
160-
"intentkit.core.credit.refill.get_session", side_effect=[first_ctx, second_ctx]
166+
"intentkit.core.credit.refill.get_session",
167+
side_effect=[first_ctx, second_ctx],
161168
),
162169
patch(
163170
"intentkit.core.credit.refill.CreditAccount.model_validate",

0 commit comments

Comments
 (0)