File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -75,9 +75,32 @@ def replace(self, response: "BaseResponse") -> "BaseResponse":
7575
7676
7777class OrderedRegistry (FirstMatchRegistry ):
78+ """Registry where `Response` objects are dependent on the insertion order and invocation index.
79+
80+ OrderedRegistry applies the rule of first in - first out. Responses should be invoked in
81+ the same order in which they were added to the registry. Otherwise, an error is returned.
82+ """
83+
7884 def find (
7985 self , request : "PreparedRequest"
8086 ) -> Tuple [Optional ["BaseResponse" ], List [str ]]:
87+ """Find the next registered `Response` and check if it matches the request.
88+
89+ Search is performed by taking the first element of the registered responses list
90+ and removing this object (popping from the list).
91+
92+ Parameters
93+ ----------
94+ request : PreparedRequest
95+ Request that was caught by the custom adapter.
96+
97+ Returns
98+ -------
99+ Tuple[Optional["BaseResponse"], List[str]]
100+ Matched `Response` object and empty list in case of match.
101+ Otherwise, None and a list with reasons for not finding a match.
102+
103+ """
81104
82105 if not self .registered :
83106 return None , ["No more registered responses" ]
You can’t perform that action at this time.
0 commit comments