Beispiel #1
0
 def test_set_bool_field(self, initial_fields, value):
     list_value, num_values = _wrapped_value_and_num(value)
     field_map = _set_protomap_from_dict(initial_fields)
     struct_utils.set_bool_field(field_map, 'field', value)
     self.assertIn('field', field_map)
     self.assertLen(field_map['field'].values, num_values)
     self.assertEqual([v.bool_value for v in field_map['field'].values],
                      list_value)
Beispiel #2
0
 def test_get_bool_field(self, value, is_single_field, expected):
     key = 'field'
     field_map = _set_protomap_from_dict({})
     struct_utils.set_bool_field(field_map, key, value)
     actual = struct_utils.get_bool_field(field_map, key, is_single_field)
     self.assertEqual(actual, expected)