Comments (9)
All objects covered
from bacpypes.
Tests are done for every objects. Some tests are failing because :
FAIL: test_object (test_ChannelObject.Test_ChannelObject)
This object is not implemented yet
FAIL: test_object (test_LoadControlObject.Test_LoadControlObject)
Need some help to define a shedLevel obejct, DateTime, ArrayOf(CharacterString)
FAIL: test_object (test_NetworkSecurityObject.Test_NetworkSecurityObject)
Need help to define a ArrayOf(NetworkSecurityPolicy), AddressBinding (Sequence)
FAIL: test_object (test_NotificationForwarderObject.Test_NotificationForwarderObject)
Need help to create a SequenceOf(EventNotificationSubscription)
from bacpypes.
I don't have any experience with channel objects. A DateTime object can be created like the other types in basetypes.py
like this:
value = DateTime(date=Date(x), time=Time(y))
Where x
and y
are appropriate initializer values (in this case 4-tuples). A single NetworkSecurityPolicy
is an object:
value = NetworkSecurityPolicy(portId=2, securityLevel='plainTrusted')
An Array
object can be initialized with a Python array, like this:
value = ArrayOf(Integer)( [1, 2, 3, 4] )
but after that the array is accessed using BACnet array semantics where the first element of the array (index 0) is the length. The SequenceOf can also be initialized with a Python array and doesn't have the funky semantics.
from bacpypes.
I found some doc on the ChannelObject... I'll send it.
from bacpypes.
Thanks Joel for your help on defining ArrayOF, Sequence and others... Now every tests are passing.
I will welcome your comments on the tests I made for objects.
from bacpypes.
...
I think I made bad assumptions on the function object_cannot_write_wrong_property_to_writableProperty
try / except is misplaced
I modified the function and now, I can't get a passing test as for some values, we can write to an object with a "almost the same type" object... actually no means to detect it automatically....
For now, I will pause and wait for comments.
from bacpypes.
The Channel Object is in Clause 12.53, so I'm all set with that. I'll check out the branch let you know what I find.
from bacpypes.
- For each of the object types there is a list of
self.listOfProperties
which seems to be a duplicate of the list in in the object class, i.e.,AnalogValueObject.properties
, with the same information but is a different form. I'm guessing that the intent to to check that the definitions match when they come from two different sources?
self.listOfProperties = [(p.__class__, p.identifier, p.datatype) for p in AnalogValueObject.properties]
- The places like this:
for each in self.listOfProperties:
would be a little easier to read if the tuple was unpacked:
for prop_class, prop_name, prop_datatype in self.listOfProperties:
-
the
object_noWritingToReadableProperty
function will pass the first time thatobj.WriteProperty
raises the ExecutionError, rather than testing all of them. -
In
object_can_write_to_writableProperty
the last testself.assertEqual(nmbrOfSuccess,nmbrOfWritableProperties)
will always pass because if any of theobj.WriteProperty
calls raises an exception, the exception will be passed up to the caller and the function exits. Theobject_cannot_write_wrong_property_to_writableProperty
function traps the exception close to the call. -
In
object_cannot_write_wrong_property_to_writableProperty
you could raise an exception for the write succeeding rather than counting them:
try:
obj.WriteProperty(actualProperty, each)
raise RuntimeError("writing " + str(each) + " to " + actualProperty + " successful and should have failed")
except (TypeError, ValueError):
pass
That way you'll get a better diagnostic message when the test fails.
-
The code seems to be missing tests for writable enumerated properties like
mode
in theTest_LifeSafetyPointObject
because none of the values in the writeValues list will match. -
This is a lot of work!
from bacpypes.
-
The idea behind listOfProperties was to define the list needed inside the test. so if something is modified inside the object, test will notify it. I know it may seem like a repetition, but (maybe due to my lack of experience) I thought that when a new property is needed for an object, we must first define a failing test... then add the feature. This was a way to allow that.
-
Really good point ! Thanks for pointing this out.
-
Yeah I see... :-(
-
I'll work on that
-
Great idea ! I'll try this
-
I guess test pass when using a simple integer. Testing all enumerated value is a big challenge alone. Do you think we should add this there ? Or should we deal with them in their own tests ?
-
Yes. A great way to better understand what's behind the hood too. But I think that the helper make that "not a too hard to follow suite of tests" as everything's in it.
from bacpypes.
Related Issues (20)
- AnalogOutput returns unrecognized-service when calling writeMultiple HOT 1
- [Question] Best practice to read/write points of multiple devices at the same IP address HOT 1
- Max APDU not segmenting correct HOT 1
- Potential Error in _parse_wp_args HOT 1
- inconsistent COV subscription response: noReponse vs timeout
- [Question] Proper BBMD.py usage HOT 3
- BACnet Services request notification
- asyncore removed from python 3.12 HOT 4
- Issue in dockerising an MSTP application using Misty and BACpypes HOT 1
- Problem with ConfirmedEventNotification in BACpypes Sample HOT 2
- BACnet device is not discoverable in Yabe HOT 4
- MAC Address from I-Am HOT 2
- Do we need to modify our code if we are prefering BACnet port as TCP over UDP? HOT 1
- Clearing / Releasing a priority HOT 2
- Dependency asyncore has been removed in python 3.12. HOT 2
- How do I alter the object properties' values while the simulator is running? HOT 1
- Remote network responds to WhoIsIAm but not ReadProperty HOT 5
- COV - how is Priority handled HOT 1
- COV subscription setting lifetime to 0 causes Error HOT 2
- Erroneous Day-of-week code in packet when building readRange log-buffer request with time-range HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bacpypes.