Skip to content

[Testing] How to assert on the requests served #1075

Answered by abhinavsingh
bmbouter asked this question in Q&A
Discussion options

You must be logged in to vote

@bmbouter Here is one option that came to my mind.

CacheResponsesPlugin

One option is to use CacheResponsesPlugin. By default it will write upstream responses in a file per request. Recently, --cache-requests flag was also added. When used, plugin will also dump request packets in the same file written per request.

Next, you will need a way to access this cached file path. Luckily, it's available as cache_file_path within access log context dictionary. Just for reference, this log context is populated from here https://github.com/abhinavsingh/proxy.py/blob/develop/proxy/plugin/cache/cache_responses.py#L54

Finally, to make this all work in your test environment

  1. Write a plugin, enable your…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@abhinavsingh
Comment options

@abhinavsingh
Comment options

Answer selected by abhinavsingh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Question Questions related to proxy server
2 participants