Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sequence of objects #130

Open
lchunleo opened this issue Mar 14, 2022 · 1 comment
Open

sequence of objects #130

lchunleo opened this issue Mar 14, 2022 · 1 comment
Assignees

Comments

@lchunleo
Copy link

lchunleo commented Mar 14, 2022

Do you have any example of sequence of objects? how it is being used in python for setDictionary?

Referring to https://community.rti.com/static/documentation/connector/1.0.0/api/python/data.html

"member name="my_point_sequence" sequenceMaxLength="10" type="nonBasic" nonBasicTypeName= "Point""

@samuelraeburn
Copy link
Collaborator

samuelraeburn commented Mar 16, 2022

Hey check out these two tests:

test_output.instance.set_dictionary({"my_point_sequence":[
{"x": 1, "y":2}, {"x": 34, "y":40}]})
sample = send_data(test_output, test_input)

def test_nested_syntax_in_dictionary(self, test_output, test_input):
test_output.instance.set_dictionary({"my_point_sequence[2].y": 153})
test_output.instance.set_dictionary({"my_point_sequence[2].x": 111})
test_output.instance["my_point_sequence[3]"] = {"x":444, "y":555}
sample = send_data(test_output, test_input)
assert sample["my_point_sequence[2]"] == {"x":111, "y":153}
assert sample["my_point_sequence[3]"] == {"x":444, "y":555}

@samuelraeburn samuelraeburn self-assigned this Mar 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants