Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_boolean(self):
if _debug: TestBoolean._debug("test_boolean")
obj = Boolean()
assert obj.value == False
with self.assertRaises(TypeError):
Boolean("some string")
with self.assertRaises(TypeError):
Boolean(1.0)
, (OptionalProperty,'covIncrement', Real)
, (OptionalProperty,'timeDelay', Unsigned)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'errorLimit', Real)
, (OptionalProperty,'deadband', Real)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
, (OptionalProperty,'backupPreparationTime', Unsigned)
, (OptionalProperty,'restorePreparationTime', Unsigned)
, (OptionalProperty,'restoreCompletionTime', Unsigned)
, (OptionalProperty,'backupAndRestoreState', BackupState)
, (OptionalProperty,'activeCovSubscriptions', SequenceOf(COVSubscription))
, (OptionalProperty,'maxSegmentsAccepted', Unsigned)
, (OptionalProperty,'slaveProxyEnable', ArrayOf(Boolean))
, (OptionalProperty,'autoSlaveDiscovery', ArrayOf(Boolean))
, (OptionalProperty,'slaveAddressBinding', SequenceOf(AddressBinding))
, (OptionalProperty,'manualSlaveAddressBinding', SequenceOf(AddressBinding))
, (OptionalProperty,'lastRestartReason', RestartReason)
, (OptionalProperty,'timeOfDeviceRestart', TimeStamp)
, (OptionalProperty,'restartNotificationRecipients', SequenceOf(Recipient))
, (OptionalProperty,'utcTimeSynchronizationRecipients', SequenceOf(Recipient))
, (OptionalProperty,'timeSynchronizationInterval', Unsigned)
, (OptionalProperty,'alignIntervals', Boolean)
, (OptionalProperty,'intervalOffset', Unsigned)
]
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'highLimit', Real)
, (OptionalProperty,'lowLimit', Real)
, (OptionalProperty,'deadband', Real)
, (OptionalProperty,'limitEnable', LimitEnable)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'eventAlgorithmInhibitRef', ObjectPropertyReference)
, (OptionalProperty,'eventAlgorithmInhibit', Boolean)
, (OptionalProperty,'timeDelayNormal', Unsigned)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
def setUp(self):
if _debug: Test_AccessRightsObject._debug("Test_AccessRightsObject")
self.obj = AccessRightsObject()
self.objType = 'accessRights'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 8
self.writeValue = 0
self.listOfProperties = \
[ (WritableProperty,'globalIdentifier', Unsigned)
, (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'reliability', Reliability)
, (ReadableProperty,'enable', Boolean)
, (ReadableProperty,'negativeAccessRules', ArrayOf(AccessRule))
, (ReadableProperty,'positiveAccessRules', ArrayOf(AccessRule))
, (OptionalProperty,'accompaniment', DeviceObjectReference)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
def setUp(self):
if _debug: Test_NotificationForwarderObject._debug("Test_NotificationForwarderObject")
self.obj = NotificationForwarderObject()
self.objType = 'notificationForwarder'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 9
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'statusFlags', StatusFlags)
, (ReadableProperty,'reliability', Reliability)
, (ReadableProperty,'outOfService', Boolean)
, (ReadableProperty,'recipientList', SequenceOf(Destination))
, (WritableProperty,'subscribedRecipients', SequenceOf(EventNotificationSubscription))
, (ReadableProperty,'processIdentifierFilter', ProcessIdSelection)
, (OptionalProperty,'portFilter', ArrayOf(PortPermission))
, (ReadableProperty,'localForwardingOnly', Boolean)
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
def setUp(self):
if _debug: Test_DateTimeValueObject._debug("Test_DateTimeValueObject")
self.obj = DateTimeValueObject()
self.objType = 'datetimeValue'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 8
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'presentValue', DateTime)
, (ReadableProperty,'statusFlags', StatusFlags)
, (OptionalProperty,'eventState', EventState)
, (OptionalProperty,'reliability', Reliability)
, (OptionalProperty,'outOfService', Boolean)
, (OptionalProperty,'priorityArray', PriorityArray)
, (OptionalProperty,'relinquishDefault', DateTime)
, (OptionalProperty,'isUtc', Boolean)
]
def setUp(self):
if _debug: Test_OctetStringValueObject._debug("Test_OctetStringValueObject")
self.obj = OctetStringValueObject()
self.objType = 'octetstringValue'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 7
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'presentValue', CharacterString)
, (ReadableProperty,'statusFlags', StatusFlags)
, (OptionalProperty,'eventState', EventState)
, (OptionalProperty,'reliability', Reliability)
, (OptionalProperty,'outOfService', Boolean)
, (OptionalProperty,'priorityArray', PriorityArray)
, (OptionalProperty,'relinquishDefault', OctetString)
]
def setUp(self):
if _debug: Test_CredentialDataInputObject._debug("Test_CredentialDataInputObject")
self.obj = CredentialDataInputObject()
self.objType = 'credentialDataInput'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 16
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'presentValue', AuthenticationFactor)
, (ReadableProperty,'statusFlags', StatusFlags)
, (OptionalProperty,'reliability', Reliability)
, (ReadableProperty,'outOfService', Boolean)
, (ReadableProperty,'supportedFormats', ArrayOf(AuthenticationFactorFormat))
, (ReadableProperty,'supportedFormatClasses', ArrayOf(Unsigned))
, (ReadableProperty,'updateTime', TimeStamp)
, (OptionalProperty,'eventDetectionEnable', Boolean)
, (OptionalProperty,'notificationClass', Unsigned)
, (OptionalProperty,'eventEnable', EventTransitionBits)
, (OptionalProperty,'ackedTransitions', EventTransitionBits)
, (OptionalProperty,'notifyType', NotifyType)
, (OptionalProperty,'eventTimeStamps', ArrayOf(TimeStamp))
, (OptionalProperty,'eventMessageTexts', ArrayOf(CharacterString))
, (OptionalProperty,'eventMessageTextsConfig', ArrayOf(CharacterString))
, (OptionalProperty,'reliabilityEvaluationInhibit', Boolean)
]
def setUp(self):
if _debug: Test_CalendarObject._debug("Test_CalendarObject")
self.obj = CalendarObject()
self.objType = 'calendar'
self.identifiers = self.build_list_of_identifiers(self.obj.properties)
self.numberOfPropertiesRequired = 2
self.writeValue = 0
self.listOfProperties = \
[ (ReadableProperty,'presentValue', Boolean)
, (ReadableProperty,'dateList', SequenceOf(CalendarEntry))
]