Skip to content

Commit

Permalink
Add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MislavReversingLabs committed Mar 26, 2024
1 parent 9ffd804 commit 23281d3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_a1000.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
from ReversingLabs.SDK import __version__
from ReversingLabs.SDK.a1000 import CLASSIFICATIONS, AVAILABLE_PLATFORMS, A1000
from ReversingLabs.SDK.helper import WrongInputError

Expand All @@ -23,13 +24,18 @@ def test_a1000_object():
a1000 = A1000(
host=valid_host,
token="my_mock_token",
verify=True,
user_agent="my_user_agent"
verify=True
)

assert a1000._url == valid_host + "{endpoint}"

with pytest.raises(WrongInputError, match=r"host parameter must contain a protocol definition at the beginning."):
A1000(host=invalid_host, token="my_mock_token")

with pytest.raises(WrongInputError, match=r"If token is not provided username and password are required."):
A1000(host=valid_host)

user_agent = a1000._headers.get("User-Agent")
assert __version__ in user_agent


0 comments on commit 23281d3

Please sign in to comment.