From python-testing
Behavior-driven testing philosophy: diamond approach, fakes over mocks, dependency injection
npx claudepluginhub remihuguet/rems-buddy --plugin python-testingThis skill uses the workspace's default tool permissions.
```python
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Provides patterns for autonomous Claude Code loops: sequential pipelines, agentic REPLs, PR cycles, de-sloppify cleanups, and RFC-driven multi-agent DAGs. For continuous dev workflows without intervention.
Applies NestJS patterns for modules, controllers, providers, DTO validation, guards, interceptors, config, and production TypeScript backends with project structure and bootstrap examples.
# Good
def test_order_creation_reserves_inventory():
fake_repo = InMemoryOrderRepository()
fake_inventory = InMemoryInventoryService()
create_order(customer_id="c1", product_id="p1", repo=fake_repo, inventory=fake_inventory)
assert fake_inventory.reserved["p1"] == 1
# Bad
def test_order_sets_status_field():
order = Order()
order._set_status("pending")
assert order._status == "pending"
# Good
def test_premium_users_get_discount():
customer = CustomerFactory(tier=Tier.PREMIUM)
product = ProductFactory(price=Decimal("100"))
order = create_order(customer.id, product.id)
assert order.total == Decimal("80")
# Bad
def test_premium_users_get_discount():
customer = CustomerFactory(tier=Tier.PREMIUM)
order = create_order(customer.id, ProductFactory(price=Decimal("100")).id)
assert order.total == Decimal("80")
assert order.discount_applied is True
another_order = create_order(customer.id, ProductFactory().id)
# Good
def test_user_cannot_order_out_of_stock_product():
...
def test_order_total_includes_shipping_for_non_premium_users():
...
# Bad
def test_order_validation():
...
def test_calculate_total_method():
...
# Good
class InMemoryOrderRepository:
def __init__(self):
self._orders: dict[str, Order] = {}
def save(self, order: Order) -> None:
self._orders[order.id] = order
def get(self, order_id: str) -> Order | None:
return self._orders.get(order_id)
# Bad
def test_order_saved(mocker):
mock_repo = mocker.Mock()
create_order("c1", "p1", repo=mock_repo)
mock_repo.save.assert_called_once() # Breaks if save() renamed
# Good
def create_order(customer_id: str, product_id: str, repo: OrderRepository) -> Order:
order = Order(customer_id, product_id)
repo.save(order)
return order
# Bad
def create_order(customer_id: str, product_id: str) -> Order:
repo = PostgreSQLOrderRepository()
order = Order(customer_id, product_id)
repo.save(order)
return order