Exemple #1
0
 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
Exemple #2
0
 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