-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from yozik04/fetch_constants_from_unit
Read constants from the unit directly or fallback to local file.
- Loading branch information
Showing
16 changed files
with
3,631 additions
and
1,828 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,2 +1,3 @@ | ||
[mypy] | ||
ignore_missing_imports = true | ||
exclude = build |
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,26 +1,32 @@ | ||
from unittest.mock import AsyncMock, patch | ||
|
||
import pytest | ||
import websockets | ||
from websockets.legacy.protocol import WebSocketCommonProtocol | ||
|
||
from vallox_websocket_api.client import Client | ||
from vallox_websocket_api.vallox import Vallox | ||
|
||
|
||
@pytest.fixture | ||
def client(): | ||
return Client("127.0.0.1") | ||
async def client(): | ||
client = Client("127.0.0.1") | ||
await client.load_local_data_model("2.0.16") | ||
|
||
return client | ||
|
||
|
||
@pytest.fixture | ||
def vallox(): | ||
return Vallox("127.0.0.1") | ||
async def vallox(): | ||
vallox = Vallox("127.0.0.1") | ||
await vallox.load_local_data_model("2.0.16") | ||
|
||
return vallox | ||
|
||
|
||
@pytest.fixture | ||
def ws(): | ||
with patch("websockets.client.connect") as connect: | ||
protocol_mock = AsyncMock(spec=websockets.WebSocketCommonProtocol) | ||
protocol_mock = AsyncMock(spec=WebSocketCommonProtocol) | ||
connect.return_value.__aenter__.side_effect = protocol_mock | ||
|
||
yield protocol_mock.return_value |
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 |
---|---|---|
|
@@ -24,4 +24,4 @@ | |
"ValloxWebsocketException", | ||
] | ||
|
||
__version__ = "3.3.0" | ||
__version__ = "4.0.0" |
Oops, something went wrong.