Esempio n. 1
0
 async def start(self, ctx):
     ctx.foo = "1"
     ctx.bar = ["2"]
     return Success()
Esempio n. 2
0
 def sucess(self, ctx):
     attendess = [{'name': 'Foo'}, {'name': 'Bar'}]
     return Success(result=attendess)
Esempio n. 3
0
 def start(self, ctx):
     return Success(foo="1", bar=["2"], baz="1")
Esempio n. 4
0
 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()
Esempio n. 6
0
 def two(self, ctx):
     return Success()
Esempio n. 7
0
 def before(self, ctx):
     return Success(foo="1", bar=["2"])
Esempio n. 8
0
 def find_results_count(self, ctx):
     """Find number of results count."""
     count = self.count(ctx.pets)
     return Success(count=count)
Esempio n. 9
0
 def find_related_photo_urls(self, ctx):
     """Find related photo urls."""
     pets = self.prefetch_photo_urls(ctx.pets)
     return Success(with_photos=pets)
Esempio n. 10
0
    def find_entries(self, ctx):

        entries = self.impl.load_entries(ctx.category)
        return Success(entries=entries)
Esempio n. 11
0
 def find_pets_for_user(self, ctx):
     """Find user's pets."""
     pets = self.load_pets_for_user(ctx.user)
     return Success(pets=pets)
Esempio n. 12
0
    def check_expiration(self, ctx):

        if ctx.subscription.is_expired():
            return Failure()
        else:
            return Success()
Esempio n. 13
0
    def find_category(self, ctx):

        category = self.impl.load_category(ctx.category_id)
        return Success(category=category)
Esempio n. 14
0
    def find_notifications(self, ctx):

        notifications = self.load_notifications(ctx.user)
        return Success(notifications=notifications)
Esempio n. 15
0
 def one(self, ctx):
     return Success(spam="0", quiz="1")
Esempio n. 16
0
 def find_related_tags(self, ctx):
     """Find related tags."""
     pets = self.prefetch_tags(ctx.with_photos)
     return Success(with_tags=pets)
Esempio n. 17
0
 def one(self, ctx):
     value = {"key": "1"}
     return Success(foo=value, bar=value, baz=value)
Esempio n. 18
0
 def find_related_category(self, ctx):
     """Find related photo category."""
     pets = self.prefetch_category(ctx.with_tags)
     return Success(with_category=pets)
Esempio n. 19
0
 def before(self, ctx):
     return Success()
Esempio n. 20
0
 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)
Esempio n. 21
0
 def after(self, ctx):
     return Success()
Esempio n. 22
0
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)
Esempio n. 24
0
 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)
Esempio n. 26
0
 def one(self, ctx):
     return Success()
Esempio n. 27
0
def mock_schedule_background_tasks():
    mock = AsyncMock(return_value=Success())
    mock.__name__ = "schedule_background_tasks"

    return mock
Esempio n. 28
0
 def one(self, ctx):
     return Success(foo="<boom>", bar=["<boom>"])
Esempio n. 29
0
 def finish(self, ctx):
     return Success()
Esempio n. 30
0
 async def before(self, ctx):
     ctx.foo = "1"
     ctx.bar = ["2"]
     return Success()