Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4 domaintools/api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from datetime import datetime, timedelta, timezone
from hashlib import sha1, sha256, md5
from hashlib import sha1, sha256
from hmac import new as hmac

import re
Expand All @@ -24,7 +24,7 @@
from domaintools.utils import validate_feeds_parameters


AVAILABLE_KEY_SIGN_HASHES = ["sha1", "sha256", "md5"]
AVAILABLE_KEY_SIGN_HASHES = ["sha1", "sha256"]


def delimited(items, character="|"):
Expand Down
11 changes: 10 additions & 1 deletion 11 tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,20 @@ def test_exception_handling():
API("notauser", "notakey").domain_search("amazon").data()
with pytest.raises(
ValueError,
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256,md5",
match=r"Invalid value 'notahash' for 'key_sign_hash'. Values available are sha1,sha256",
):
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="notahash").domain_search("amazon")


@vcr.use_cassette
def test_md5_is_not_supported():
with pytest.raises(
ValueError,
match=r"Invalid value 'md5' for 'key_sign_hash'. Values available are sha1,sha256",
):
API("notauser", "notakey", always_sign_api_key=True, key_sign_hash="md5").domain_search("amazon")


@vcr.use_cassette
def test_rate_limiting():
domain_searches = ["google"] * 31
Expand Down
13 changes: 9 additions & 4 deletions 13 tox.ini
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
[tox]
envlist=py39, py310, py311
envlist =
py39,
py310,
py311
skip_missing_interpreters=true

[testenv]
passenv=
passenv =
TEST_USER
TEST_KEY
deps=
deps =
click==8.1.8
pytest
pytest-cov
httpx
vcrpy
rich
typer
.
commands=py.test -s --capture=sys --cov=domaintools --cov=domaintools_async tests
commands =
py.test -s --capture=sys --cov=domaintools --cov=domaintools_async tests
coverage html
Morty Proxy This is a proxified and sanitized view of the page, visit original site.