-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
"""Exceptions for DIOChaconAPIClient.""" | ||
"""Exceptions for DIOChacon API.""" | ||
|
||
|
||
class DIOChaconAPIError(Exception): | ||
"""Error from this api.""" | ||
|
||
def __init__(self, *args) -> None: | ||
Exception.__init__(self, *args) | ||
|
||
|
||
class DIOChaconInvalidAuthError(Exception): | ||
"""Invalid auth detected""" | ||
|
||
def __init__(self, *args) -> None: | ||
Exception.__init__(self, *args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# coding: utf-8 | ||
"""Tests exceptions.""" | ||
import pytest | ||
from dio_chacon_wifi_api.exceptions import DIOChaconAPIError | ||
from dio_chacon_wifi_api.exceptions import DIOChaconInvalidAuthError | ||
|
||
|
||
def test_exceptions() -> None: | ||
|
||
with pytest.raises(DIOChaconAPIError): | ||
raise DIOChaconAPIError("Dumb test coverage") | ||
|
||
with pytest.raises(DIOChaconInvalidAuthError): | ||
raise DIOChaconInvalidAuthError("Dumb 2") |