Update session.py methods to support simulated behaviours
Some optional parameters are needed to chose behaviours to simulate:
--- a/kilter/service/session.py
+++ b/kilter/service/session.py
@@ -305,7 +305,7 @@ class Session:
- async def envelope_recipients(self) -> AsyncIterator[str]:
+ async def envelope_recipients(self, rejected: bool = ...) -> AsyncIterator[str]:
Note: For Sendmail ≥ 8.14 or Postfix ≥ 2.6 the
{rcpt_mailer}
macro will have the value "error" for rejected recipients, which can be used to detect them.
--- a/kilter/service/session.py
+++ b/kilter/service/session.py
@@ -408,6 +408,9 @@ class HeadersAccessor(AsyncContextManager["HeaderIterator"]):
+ async def raw(self) -> AsyncContextManager[HeaderIterator]: ...
--- a/kilter/service/session.py
+++ b/kilter/service/session.py
@@ -551,6 +554,11 @@ class BodyAccessor(AsyncContextManager[AsyncIterator[memoryview]]):
+
+ async def in_size(
+ self,
+ size: Literal[ProtocolFlags.MDS_1M, ProtocolFlags.MDS_256K],
+ ) -> AsyncContextManager[AsyncIterator[memoryview]]: ...
Edited by Dom Sekotill