-
-
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.
API for queue with received packets (#116)
- define API for queue with received packets - in module docstrings, add references to knowledge base - move `is_initial_packet` method to `UDSPacketType` implementation instead of `Segmenter` class.
- Loading branch information
1 parent
c66a8b3
commit 1710be9
Showing
12 changed files
with
188 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pytest>=6.2.2 | ||
pytest-cov>=2.11.1 | ||
pytest-asyncio>=0.15.1 | ||
mock>=4.0.2 |
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
Empty file.
55 changes: 55 additions & 0 deletions
55
tests/software_tests/transport_interface/test_packet_queue.py
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,55 @@ | ||
import pytest | ||
from mock import Mock | ||
|
||
from uds.transport_interface.packet_queue import ReceivedPacketsQueue | ||
|
||
|
||
class TestReceivedPacketsQueue: | ||
"""Tests for `ReceivedPacketsQueue class.""" | ||
|
||
def setup(self): | ||
self.mock_received_packets_queue = Mock(spec=ReceivedPacketsQueue) | ||
|
||
# __init__ | ||
|
||
def test_init(self): | ||
with pytest.raises(NotImplementedError): | ||
ReceivedPacketsQueue.__init__(self=self.mock_received_packets_queue, packet_class=Mock()) | ||
|
||
# __del__ | ||
|
||
def test_del(self): | ||
with pytest.raises(NotImplementedError): | ||
ReceivedPacketsQueue.__del__(self=self.mock_received_packets_queue) | ||
|
||
# __len__ | ||
|
||
def test_len(self): | ||
with pytest.raises(NotImplementedError): | ||
ReceivedPacketsQueue.__len__(self=self.mock_received_packets_queue) | ||
|
||
# is_empty | ||
|
||
def test_is_empty(self): | ||
with pytest.raises(NotImplementedError): | ||
ReceivedPacketsQueue.is_empty(self=self.mock_received_packets_queue) | ||
|
||
# packet_task_done | ||
|
||
def test_packet_task_done(self): | ||
with pytest.raises(NotImplementedError): | ||
ReceivedPacketsQueue.packet_task_done(self=self.mock_received_packets_queue) | ||
|
||
# get_packet | ||
|
||
@pytest.mark.asyncio | ||
async def test_get_packet(self): | ||
with pytest.raises(NotImplementedError): | ||
await ReceivedPacketsQueue.get_packet(self=self.mock_received_packets_queue) | ||
|
||
# put_packet | ||
|
||
@pytest.mark.asyncio | ||
async def test_put_packet(self): | ||
with pytest.raises(NotImplementedError): | ||
await ReceivedPacketsQueue.put_packet(self=self.mock_received_packets_queue, packet=Mock()) |
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
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,5 @@ | ||
""" | ||
A subpackage with UDS middle layers (Transport and Network) implementation. | ||
TODO: provide more information when implementing tasks that expands capabilities of this package | ||
""" |
Oops, something went wrong.