Skip to content

Commit bc187cc

Browse files
committed
update test cases
1 parent 17dcbf9 commit bc187cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+35331
-80
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.5.3
1+
2.6.0

domaintools/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
2121
"""
2222

23-
current = "2.5.3"
23+
current = "2.6.0"

domaintools/base_results.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def __init__(
5757
self._response = None
5858
self._items_list = None
5959
self._data = None
60+
self._status = None
6061

6162
def _wait_time(self):
6263
if not self.api.rate_limit or not self.product in self.api.limits:
@@ -174,7 +175,7 @@ def check_limit_exceeded(self):
174175

175176
@property
176177
def status(self):
177-
if not getattr(self, "_status", None):
178+
if not getattr(self, "_status", None) and not self.product in RTTF_PRODUCTS_LIST:
178179
self._status = self._get_results().status_code
179180

180181
return self._status

domaintools/results.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,7 @@ def _make_request(self) -> Generator:
243243

244244
for line in response.iter_lines():
245245
if line:
246-
try:
247-
yield json.loads(line)
248-
except json.JSONDecodeError as e:
249-
log.error(f"JSON Decode Error: {e}")
250-
continue
246+
yield line
251247
except Exception as e:
252248
self.latest_feeds_status_code = 500
253249
yield {"status_ready": True, "error": str(e)}
@@ -259,6 +255,8 @@ def _get_results(self) -> Generator:
259255
feeds_generator = self._make_request()
260256

261257
next(feeds_generator) # to start the generator process
258+
self.setStatus(self.latest_feeds_status_code) # set the status already
259+
262260
should_wait = (
263261
wait_for
264262
and wait_for > 0
@@ -287,8 +285,7 @@ def response(self) -> Generator:
287285
feed_response_generator = self.data()
288286

289287
yield from feed_response_generator
290-
291-
status_code = self.latest_feeds_status_code
288+
status_code = self.status
292289
self._data = None # clear the data here
293290

294291
if not self.kwargs.get("sessionID"):
@@ -299,3 +296,6 @@ def response(self) -> Generator:
299296
self.latest_feeds_status_code = 500
300297
self.setStatus(500, reason_text=f"Reason: {e}")
301298
break # safely close the while loop if there's any error above
299+
300+
def __str__(self):
301+
return f"{self.__class__.__name__} - {self.product}"

tests/fixtures/vcr/test_account_information.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,4 +738,68 @@ interactions:
738738
status:
739739
code: 200
740740
message: OK
741+
- request:
742+
body: ''
743+
headers:
744+
accept:
745+
- '*/*'
746+
accept-encoding:
747+
- gzip, deflate
748+
connection:
749+
- keep-alive
750+
host:
751+
- api.domaintools.com
752+
user-agent:
753+
- python-httpx/0.28.1
754+
method: GET
755+
uri: https://api.domaintools.com/v1/account?app_name=python_wrapper&app_version=2.6.0
756+
response:
757+
body:
758+
string: !!binary |
759+
H4sIAAAAAAAAA9WZYY+iMBCG/wuf7hKbAIq6+1cuF9OFUSYLLWmLnjH+9xsQN5gVtygi+EmXFp6Z
760+
vrzTzh4cBTqTQoPzfnB4GMpcmPJrhqtcgxI8pUsOCgMbxQ3S0JUBbVBsnAlNMLil60blcJw4mZJR
761+
HhrtvP85OBjRvOqODMVaqrScT9MyUKtUChOvEkyRnud4bvGpLsUyV+crIk+SagKK3MDXjKB4/IeW
762+
Se2Pp8G55psyHCMjvi9u7vk0uHwg/Vp47twhWPiX4SmiVcQNnGYfJxU4KtREvS1C3RSXG6nbQPuu
763+
PXXwVoOe+m+WzCAUhvFVXL8t7rwF7nJZw/V8z11YAkdgIDQMdMgTGsIimXIU+nrCg3YBTFsE4Nb4
764+
3XbsuBFSQXQPOmnI6RTdn7VjT7mgu7EdN2GcoDad5t9rI/gHFoCmoZHqxdBzW1+pqAXshiEZrx13
765+
qZWByH1qIfcTJ6PqtMbkhpP3oxJ7YA1cNVj5HfXSvVcd05+BY1nuCFhMBiLVfgQpxuxsGv3vR9qj
766+
KthQZhUXZhjUFvasIMtNlxu+Z6pBwRaUBoZZV7B9sLJdLLHBfvtL79ICGfXnqzE9N7ADZbDFCEQ4
767+
hkJx1kJxSqNyoejXeATcqXqfh5ty9cl4AsoMvlJknPIaDcMWLHBrqh1GWbNgHkRuLSy35Ly5Hwv6
768+
og2WFr2LunRZUjSVrubYH8zu5mtDNg5roLNmsmenft354MbWQCn/xTP83RF/G4kUbbhaeZ65M4sC
769+
fQpDfpSuEQ0kkMC7CMRfWJynK71XJz0V8es7z6A3T7EQ/Rm20n4xjNEwTrIKQevigG1kKJNX62p5
770+
qaup1fvME2YwPb8bLEIdSipM+7uDqZnVI2v07TXxLbpMP4ajp10tzd2CsygKLQU3gKAspHbDibsL
771+
4On8DRY8xgiK5tX9JaT5NX/AtPxg8Vgco1iHby4VS1P+C+KFbhtcdD5nNs2Nxig69KMeF6HsgQxl
772+
BTyb/n5DCINO/9/j8T8fFfGrfB8AAA==
773+
headers:
774+
Access-Control-Allow-Origin:
775+
- '*'
776+
Cache-Control:
777+
- no-store, no-cache, must-revalidate
778+
Content-Encoding:
779+
- gzip
780+
Content-Security-Policy:
781+
- 'default-src * data: blob: ''unsafe-eval'' ''unsafe-inline'''
782+
Content-Type:
783+
- application/json;charset=utf-8
784+
Date:
785+
- Wed, 22 Oct 2025 10:50:56 GMT
786+
Expires:
787+
- Thu, 19 Nov 1981 08:52:00 GMT
788+
Pragma:
789+
- no-cache
790+
Set-Cookie:
791+
- dtsession=tja8k9d04c08ql3d9qcmfngdcoem3fjrj7hh45h0ks62tf1v0bnos3nft1s5gije4qtn3sisb56p8fcjb907q1nt3jfebfmdeo87qr2;
792+
expires=Fri, 21-Nov-2025 10:50:56 GMT; Max-Age=2592000; path=/; domain=.domaintools.com;
793+
secure; HttpOnly
794+
Strict-Transport-Security:
795+
- max-age=31536000; includeSubDomains
796+
Transfer-Encoding:
797+
- chunked
798+
Vary:
799+
- Accept-Encoding
800+
X-TIME:
801+
- '131975'
802+
status:
803+
code: 200
804+
message: OK
741805
version: 1

0 commit comments

Comments
 (0)