Ejemplo n.º 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
Ejemplo n.º 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")
Ejemplo n.º 3
0
 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