Skip to content

Commit

Permalink
Add tests for exception classes
Browse files Browse the repository at this point in the history
  • Loading branch information
timmo001 committed Mar 5, 2024
1 parent 35dec30 commit 93cebd9
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/test_exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""Test the exceptions module."""

from systembridgeconnector.exceptions import (
AuthenticationException,
BadMessageException,
ConnectionClosedException,
ConnectionErrorException,
)


def test_authentication_exception():
"""Test the AuthenticationException."""
exception = AuthenticationException("Test")
assert exception is not None
assert str(exception) == "Test"


def test_bad_message_exception():
"""Test the BadMessageException."""
exception = BadMessageException("Test")
assert exception is not None
assert str(exception) == "Test"


def test_connection_closed_exception():
"""Test the ConnectionClosedException."""
exception = ConnectionClosedException("Test")
assert exception is not None
assert str(exception) == "Test"


def test_connection_error_exception():
"""Test the ConnectionErrorException."""
exception = ConnectionErrorException("Test")
assert exception is not None
assert str(exception) == "Test"

0 comments on commit 93cebd9

Please sign in to comment.