Dissallow serial to ethernet connection

Fix #678
This commit is contained in:
Julien Duponchelle committed 2016-09-15 14:51:40 +02:00
1 parent 5d12a91268
commit da5e3d0e54
18 files changed
+184 -78

No files matched your search

+13
View File
@@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import aiohttp
import pytest
import uuid
import asyncio
@@ -420,3 +421,15 @@ def test_update_label(node):
node.label = {"text": "Wrong", "x": 12}
assert node.label["text"] == "Test"
assert node.label["x"] == 12
def test_get_port(node):
node.properties["adapters"] = 2
node._list_ports()
port = node.get_port(0, 0)
assert port.adapter_number == 0
assert port.port_number == 0
port = node.get_port(1, 0)
assert port.adapter_number == 1
with pytest.raises(aiohttp.web.HTTPNotFound):
port = node.get_port(42, 0)