Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding machine ID to proxy test payload and init #92

Open
wants to merge 1 commit into
base: 0.0.5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions carpetbag/base_carpetbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class BaseCarpetBag(object):

__version__ = "0.0.5i01"
__version__ = "0.0.5j01"

def __init__(self):
"""
Expand Down Expand Up @@ -107,6 +107,7 @@ def __init__(self):
self.force_skip_ssl_verify = False
self.send_usage_stats_val = False
self.usage_stats_api_key = ""
self.usage_stats_machine_id = ""
self.retry_on_proxy_failure = True

self.one_time_headers = []
Expand Down Expand Up @@ -706,7 +707,8 @@ def _send_usage_stats(self, success=True):
"response_success": success,
# "response_ip": "",
"user_ip": self.non_proxy_user_ip,
"score": 0
"score": 0,
"machine_id": self.usage_stats_machine_id,
}

proxy_quality = self.proxy_bag[0]["quality"]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_base_carpetbag.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def test___init__(self):
assert not bagger.send_usage_stats_val
assert isinstance(bagger.usage_stats_api_key, str)
assert not bagger.usage_stats_api_key
assert isinstance(bagger.usage_stats_machine_id, str)
assert not bagger.usage_stats_machine_id
assert isinstance(bagger.one_time_headers, list)
assert not bagger.force_skip_ssl_verify

Expand Down