Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Add a test and impl for map field mock value#335

Merged
software-dov merged 1 commit intogoogleapis:masterfrom
software-dov:mock-map
Mar 5, 2020
Merged

Add a test and impl for map field mock value#335
software-dov merged 1 commit intogoogleapis:masterfrom
software-dov:mock-map

Conversation

@software-dov
Copy link
Copy Markdown
Contributor

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. This allows certain generated unit tests to pass that previously wouldn't.

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.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 5, 2020
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 5, 2020

Codecov Report

Merging #335 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #335   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          25     25           
  Lines        1395   1397    +2     
  Branches      288    289    +1     
=====================================
+ Hits         1395   1397    +2
Impacted Files Coverage Δ
gapic/schema/wrappers.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 65041f2...44ab890. Read the comment docs.

@software-dov software-dov merged commit b2ea14a into googleapis:master Mar 5, 2020
@software-dov software-dov deleted the mock-map branch March 5, 2020 02:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants