1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-10-27 00:57:47 +08:00

a little better parameter type checking, a lot more tests

This commit is contained in:
Joel Bender
2015-08-03 14:29:58 -04:00
parent 4570f1dbfc
commit 181e224ae0
4 changed files with 319 additions and 23 deletions

View File

@@ -356,6 +356,8 @@ class LocalStation(Address):
class RemoteStation(Address):
def __init__(self, net, addr):
if not isinstance(net, int):
raise TypeError("integer network required")
if (net < 0) or (net >= 65535):
raise ValueError("network out of range")
@@ -396,7 +398,9 @@ class LocalBroadcast(Address):
class RemoteBroadcast(Address):
def __init__(self,net):
def __init__(self, net):
if not isinstance(net, int):
raise TypeError("integer network required")
if (net < 0) or (net >= 65535):
raise ValueError("network out of range")