delvedor / hpagent

A ready to use http and https agent for working with proxies that keeps connections alive!
MIT License
181 stars 37 forks source link

Rewrite tests to be parameterized #71

Open mbargiel opened 2 years ago

mbargiel commented 2 years ago

This looks like a big PR but it can be summarized simply as factoring out all the repeated code in tests that cover the exact same flow but with one of the four combinations (http over http, http over https, https over http, https over https). It implements the DRY principle in the tests.

The PR changes are as follows:

I recommend taking this PR to avoid writing 4x the number of tests every time a feature is added, and guarantee that test coverage is the same for all variations. You can still implement tests specific to individual combinations but currently none is needed.

This is the PR I mentioned in this Issue comment.

Note: this PR introduces a merge conflict with #72. Whichever lands first will require a manual merge before the other can land.

mbargiel commented 1 year ago

Now that #72 landed, I'll need to rebase this PR and fix the merge conflicts. Before I do that, could you please at least let me know if you're interested in this change?