-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from wimglenn/update-user-agent
include email contact in user-agent string, closes #90
- Loading branch information
Showing
3 changed files
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ | |
AOCD_DATA_DIR = os.path.expanduser(os.environ.get("AOCD_DIR", os.path.join("~", ".config", "aocd"))) | ||
AOCD_CONFIG_DIR = os.path.expanduser(os.environ.get("AOCD_CONFIG_DIR", AOCD_DATA_DIR)) | ||
URL = "https://adventofcode.com/{year}/day/{day}" | ||
USER_AGENT = {"User-Agent": "advent-of-code-data v{}".format(__version__)} | ||
USER_AGENT = {"User-Agent": "github.com/wimglenn/advent-of-code-data v{} by [email protected]".format(__version__)} | ||
|
||
|
||
class User(object): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "1.2.2" | ||
__version__ = "1.2.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ def test_aocd_user_agent_in_req_headers(requests_mock): | |
aocd.get_data(year=2018, day=1) | ||
assert mock.call_count == 1 | ||
headers = mock.last_request._request.headers | ||
expected = "advent-of-code-data v{}".format(aocd.__version__) | ||
expected = "github.com/wimglenn/advent-of-code-data v{} by [email protected]".format(aocd.__version__) | ||
assert headers["User-Agent"] == expected | ||
|
||
|
||
|