Skip to content

Commit

Permalink
chg: Update typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafiot committed Feb 6, 2024
1 parent f68c9c5 commit bf44d56
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions tests/testing.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from __future__ import annotations

import argparse
import json
Expand All @@ -8,7 +9,6 @@

from io import StringIO
from unittest import mock
from typing import Dict, Union, List

from pyhashlookup import Hashlookup, main, PyHashlookupError

Expand All @@ -27,11 +27,11 @@ def test_fix_url(self) -> None:

def test_info_over_dns(self) -> None:
response = self.public_instance.info_over_dns()
assert 'hashlookup-version' in response
assert 'nsrl-version' in response

def test_info(self) -> None:
response = self.public_instance.info()
assert 'hashlookup-version' in response
assert 'nsrl-version' in response

def test_top(self) -> None:
response = self.public_instance.top()
Expand All @@ -43,11 +43,11 @@ def test_lookup(self) -> None:
sha256 = '301C9EC7A9AADEE4D745E8FD4FA659DAFBBCC6B75B9FF491D14CBBDD840814E9'
bulk_md5 = ['6E2F8616A01725DCB37BED0A2495AEB2', '8ED4B4ED952526D89899E723F3488DE4', '344428FA4BA313712E4CA9B16D089AC4']
bulk_sha1 = ['FFFFFDAC1B1B4C513896C805C2C698D9688BE69F', 'FFFFFF4DB8282D002893A9BAF00E9E9D4BA45E65', 'FFFFFE4C92E3F7282C7502F1734B243FA52326FB']
response_md5: Dict[str, Union[str, Dict[str, str]]] = self.public_instance.lookup(md5)
response_sha1: Dict[str, Union[str, Dict[str, str]]] = self.public_instance.lookup(sha1)
response_sha256: Dict[str, Union[str, Dict[str, str]]] = self.public_instance.lookup(sha256)
response_bulk_md5: List[Dict[str, str]] = self.public_instance.lookup(bulk_md5)
response_bulk_sha1: List[Dict[str, str]] = self.public_instance.lookup(bulk_sha1)
response_md5: dict[str, str | dict[str, str]] = self.public_instance.lookup(md5)
response_sha1: dict[str, str | dict[str, str]] = self.public_instance.lookup(sha1)
response_sha256: dict[str, str | dict[str, str]] = self.public_instance.lookup(sha256)
response_bulk_md5: list[dict[str, str]] = self.public_instance.lookup(bulk_md5)
response_bulk_sha1: list[dict[str, str]] = self.public_instance.lookup(bulk_sha1)

assert response_md5['CRC32'] == '7A5407CA'

Expand All @@ -71,11 +71,11 @@ def test_lookup(self) -> None:

def test_dns_lookup(self) -> None:
md5 = '6E2F8616A01725DCB37BED0A2495AEB2'
response_md5: Dict[str, Union[str, Dict[str, str]]] = self.public_instance.md5_lookup_over_dns(md5)
response_md5: dict[str, str | dict[str, str]] = self.public_instance.md5_lookup_over_dns(md5)
assert response_md5['SHA-1'] == '00000903319A8CE18A03DFA22C07C6CA43602061'

sha1 = 'FFFFFDAC1B1B4C513896C805C2C698D9688BE69F'
response_sha1: Dict[str, Union[str, Dict[str, str]]] = self.public_instance.sha1_lookup_over_dns(sha1)
response_sha1: dict[str, str | dict[str, str]] = self.public_instance.sha1_lookup_over_dns(sha1)
assert response_sha1['MD5'] == '131312A96CAD4ACAA7E2631A34A0D47C'
sha1 = 'FFFFFF4DB8282D002893A9BAF00E9E9D4BA45E65'
response_sha1 = self.public_instance.sha1_lookup_over_dns(sha1)
Expand Down

0 comments on commit bf44d56

Please sign in to comment.