Skip to content

Commit

Permalink
[TestConstraints] Add some tests for the hasValue constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien-apple committed Feb 15, 2023
1 parent 9524caf commit 38085a5
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions src/app/tests/suites/TestConstraints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,81 @@ tests:
attribute: "char_string"
arguments:
value: ""

# Tests for hasValue attribute

- label: "Read attribute NULLABLE_INT8U Default Value"
command: "readAttribute"
attribute: "nullable_int8u"
response:
value: 0

- label: "Write attribute NULLABLE_INT8U with a value"
command: "writeAttribute"
attribute: "nullable_int8u"
arguments:
value: 0

- label: "Read attribute NULLABLE_INT8U with a value"
command: "readAttribute"
attribute: "nullable_int8u"
response:
constraints:
hasValue: true

- label: "Write attribute NULLABLE_INT8U without a value"
command: "writeAttribute"
attribute: "nullable_int8u"
arguments:
value: null

- label: "Read attribute NULLABLE_INT8U with a value"
command: "readAttribute"
attribute: "nullable_int8u"
response:
constraints:
hasValue: false

- label: "Write attribute NULLABLE_INT8U back to Default Value"
command: "writeAttribute"
attribute: "nullable_int8u"
arguments:
value: 0

- label: "Read attribute NULLABLE_OCTET_STRING Default Value"
command: "readAttribute"
attribute: "nullable_octet_string"
response:
value: ""

- label: "Write attribute NULLABLE_OCTET_STRING"
command: "writeAttribute"
attribute: "nullable_octet_string"
arguments:
value: "TestValue"

- label: "Read attribute NULLABLE_OCTET_STRING"
command: "readAttribute"
attribute: "nullable_octet_string"
response:
constraints:
hasValue: true

- label: "Write attribute NULLABLE_OCTET_STRING"
command: "writeAttribute"
attribute: "nullable_octet_string"
arguments:
value: null

- label: "Read attribute NULLABLE_OCTET_STRING"
command: "readAttribute"
attribute: "nullable_octet_string"
response:
constraints:
hasValue: false

- label: "Write attribute NULLABLE_OCTET_STRING back to Default Value"
command: "writeAttribute"
attribute: "nullable_octet_string"
arguments:
value: ""

0 comments on commit 38085a5

Please sign in to comment.