Function to verify that a session looks complete. A valid session contains a valid list of transactions. Args: transaction (json object) fabricate_proxy_requests (bool) Whether the post-processor should fabricate proxy requests if they don't exist because the
(session, fabricate_proxy_requests=False)
| 154 | |
| 155 | |
| 156 | def verify_session(session, fabricate_proxy_requests=False): |
| 157 | """ Function to verify that a session looks complete. |
| 158 | |
| 159 | A valid session contains a valid list of transactions. |
| 160 | |
| 161 | Args: |
| 162 | transaction (json object) |
| 163 | fabricate_proxy_requests (bool) Whether the post-processor should |
| 164 | fabricate proxy requests if they don't exist because the proxy served |
| 165 | the response locally. |
| 166 | |
| 167 | Raises: |
| 168 | VerifyError if there is a problem with the session. |
| 169 | """ |
| 170 | if not session: |
| 171 | raise VerifySessionError('Session not found.') |
| 172 | if "transactions" not in session or not session["transactions"]: |
| 173 | raise VerifySessionError('No transactions found in session.') |
| 174 | for transaction in session["transactions"]: |
| 175 | verify_transaction(transaction, fabricate_proxy_requests) |
| 176 | |
| 177 | |
| 178 | def write_sessions(sessions, filename, indent): |
no test coverage detected