Fix problem with uninitialized unions in _from_dict

This commit is contained in:
Jason Paryani
2014-02-18 17:34:34 -08:00
parent 110b454e2c
commit 307fcbf4e7
3 changed files with 18 additions and 2 deletions

View File

@@ -164,3 +164,9 @@ def test_set_dict(all_types):
msg.structList[0] = {'int32Field': 102}
assert msg.structList[0].int32Field == 102
def test_set_dict_union(addressbook):
person = addressbook.Person.new_message(**{'employment': {'employer': {'name': 'foo'}}})
assert person.employment.employer.name == 'foo'