def client(self): ctx = stack.top if ctx is not None: if not hasattr(ctx, 'postmark_client'): ctx.postmark_client = PostmarkClient.from_config( current_app.config, is_uppercase=True) return ctx.postmark_client
def client(self) -> PostmarkClient: ctx = stack.top if ctx is not None: if not hasattr(ctx, "postmark_client"): app = self._get_app() ctx.postmark_client = PostmarkClient.from_config( app.config, is_uppercase=True) return ctx.postmark_client raise RuntimeError("Context stack is empty")
def test_from_config(self, config, kwargs): instance = PostmarkClient.from_config(config, **kwargs) assert instance.server_token == "foo" assert instance.timeout == 1 assert instance.account_token is None