async def start(self, ctx): ctx.foo = "1" ctx.bar = ["2"] return Success()
def sucess(self, ctx): attendess = [{'name': 'Foo'}, {'name': 'Bar'}] return Success(result=attendess)
def start(self, ctx): return Success(foo="1", bar=["2"], baz="1")
def start(self, ctx): return Success()
def increase_balance(self, ctx): self.add_balance(ctx.profile, ctx.amount) self.save_profile(ctx.profile) return Success()
def two(self, ctx): return Success()
def before(self, ctx): return Success(foo="1", bar=["2"])
def find_results_count(self, ctx): """Find number of results count.""" count = self.count(ctx.pets) return Success(count=count)
def find_related_photo_urls(self, ctx): """Find related photo urls.""" pets = self.prefetch_photo_urls(ctx.pets) return Success(with_photos=pets)
def find_entries(self, ctx): entries = self.impl.load_entries(ctx.category) return Success(entries=entries)
def find_pets_for_user(self, ctx): """Find user's pets.""" pets = self.load_pets_for_user(ctx.user) return Success(pets=pets)
def check_expiration(self, ctx): if ctx.subscription.is_expired(): return Failure() else: return Success()
def find_category(self, ctx): category = self.impl.load_category(ctx.category_id) return Success(category=category)
def find_notifications(self, ctx): notifications = self.load_notifications(ctx.user) return Success(notifications=notifications)
def one(self, ctx): return Success(spam="0", quiz="1")
def find_related_tags(self, ctx): """Find related tags.""" pets = self.prefetch_tags(ctx.with_photos) return Success(with_tags=pets)
def one(self, ctx): value = {"key": "1"} return Success(foo=value, bar=value, baz=value)
def find_related_category(self, ctx): """Find related photo category.""" pets = self.prefetch_category(ctx.with_tags) return Success(with_category=pets)
def before(self, ctx): return Success()
def apply_limit_and_offset(self, ctx): """Filter results with limit and offset.""" pets = self.limit_offset(ctx.with_category, ctx.limit, ctx.offset) return Success(limitted=pets)
def after(self, ctx): return Success()
def test_success_representation(): success = Success() assert repr(success) == "Success()"
def find_profile(self, ctx): profile = self.load_profile(ctx.user) return Success(profile=profile)
async def one(self, ctx): ctx.foo = self.foo return Success()
def send_income_notification(self, ctx): notification = self.send_notification("income", ctx.profile, ctx.amount) return Success(notification=notification)
def one(self, ctx): return Success()
def mock_schedule_background_tasks(): mock = AsyncMock(return_value=Success()) mock.__name__ = "schedule_background_tasks" return mock
def one(self, ctx): return Success(foo="<boom>", bar=["<boom>"])
def finish(self, ctx): return Success()
async def before(self, ctx): ctx.foo = "1" ctx.bar = ["2"] return Success()