Skip to content

Conversation

un33k
Copy link
Owner

@un33k un33k commented Apr 17, 2024

Allow for proxy_count of exact 0

@coveralls
Copy link

coveralls commented Apr 17, 2024

Coverage Status

coverage: 94.815% (+1.4%) from 93.382%
when pulling 1773c76 on feat/countzero
into ddfde3c on main.


# the incoming ips match our proxy count
if self.proxy_count > 0 and proxy_count_validated:
if self.proxy_count and self.proxy_count > 0 and proxy_count_validated:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I would just check if self.proxy_count is not None and proxy_count_validated because self.proxy_count = 0 now also means that the proxy_count did go through validation. If I change this, I have to adapt the tests test_proxy_count_zero_dont_care_proxy_pass and test_proxy_count_zero_exact_zero_proxy_pass.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! thx

precedence: Optional[Tuple[str, ...]] = None,
leftmost: bool = True,
proxy_count: int = 0,
leftmost: Optional[bool] = True,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why you make leftmost an Optional[bool]. Passing leftmost=None seems to have the same effect as leftmost=False.

Copy link
Owner Author

@un33k un33k Apr 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing stuff. It is a boolean.

@un33k un33k merged commit bd56bcd into main Apr 18, 2024
@un33k un33k deleted the feat/countzero branch April 18, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants