Logo
Explore Help
Sign In
oxbrbtx/PrimAITE
1
0
Fork 0
You've already forked PrimAITE
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
b08683fcd322919ce59c9c646d98121265caaa88
PrimAITE/tests/integration_tests/network/test_nic_link_connection.py

15 lines
446 B
Python
Raw Normal View History

#1715 - Added more tests. MAde use of the pydantic model_post_init function for proper ipv4 cofiguration checking. Added NetworkError to exceptions.py.
2023-07-31 16:55:45 +01:00
import pytest
#1724 - Added the primaite/simulator/network/transmission sub-package with modules for each layer. They come together to build a minimal but fairly realistic network Frame. A custom PrimaiteHeader has been included to hold primaite specific metadata required in transmission for reward function and RL agent downstream. Added some basic tests that check the proper configuration of Frames with matching headers for protocols. Updated the frame typehints in NIC and Link classes.
2023-08-01 22:25:00 +01:00
from primaite.simulator.network.transmission.physical_layer import Link, NIC
#1715 - Added more tests. MAde use of the pydantic model_post_init function for proper ipv4 cofiguration checking. Added NetworkError to exceptions.py.
2023-07-31 16:55:45 +01:00
def test_link_fails_with_same_nic():
"""Tests Link creation fails with endpoint_a and endpoint_b are the same NIC."""
with pytest.raises(ValueError):
nic_a = NIC(
ip_address="192.168.1.2",
subnet_mask="255.255.255.0",
gateway="192.168.0.1",
)
Link(endpoint_a=nic_a, endpoint_b=nic_a)
Reference in New Issue Copy Permalink
Powered by Gitea Page: 399ms Template: 50ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API