This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Commit b2ea14a
authored
Add a test and impl for map field mock value (#335)
Protobuf map fields are special: under the hood they are implemnted as a
sequence of generated type with two fields: 'key', whose type is the
map key type, and 'value', whose type is the map value type.
The user almost never wants to know about this implementation detail,
and the python proto surface allows python dictionaries as rvalues
when assigning to a mapped field.
This change uses dict literals in generated unit tests where flattened
parameters may refer to mapped fields.1 parent 65041f2 commit b2ea14a
3 files changed
Lines changed: 56 additions & 6 deletions
File tree
- gapic
- schema
- templates/%namespace/%name_%version/%sub/services/%service
- tests/unit/schema/wrappers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
116 | 123 | | |
117 | 124 | | |
118 | 125 | | |
| |||
568 | 575 | | |
569 | 576 | | |
570 | 577 | | |
571 | | - | |
572 | 578 | | |
573 | 579 | | |
574 | 580 | | |
| |||
585 | 591 | | |
586 | 592 | | |
587 | 593 | | |
| 594 | + | |
588 | 595 | | |
589 | 596 | | |
590 | 597 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
176 | 195 | | |
177 | 196 | | |
178 | 197 | | |
| |||
227 | 246 | | |
228 | 247 | | |
229 | 248 | | |
230 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
0 commit comments