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

Fix Root.add_key() argument's type #1386

Merged
merged 1 commit into from
May 14, 2021

Conversation

sechkova
Copy link
Contributor

Fixes #1378

Description of the changes being introduced by the pull request:

Since the existence of a Key class, taking Key as an argument type seems like the logical change.
The test case is updated accordingly.

Since there are no "users" of this functionality yet, I can't say if further improvements are
needed for now.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

@sechkova
Copy link
Contributor Author

Force-pushed after I changed my mind over the test case a bit

Copy link
Member

@jku jku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks ok to me but could you add a regression test so root metadata with an added key serializes correctly (a test that fails with current develop and succeeds with your fix)?

@sechkova
Copy link
Contributor Author

looks ok to me but could you add a regression test so root metadata with an added key serializes correctly (a test that fails with current develop and succeeds with your fix)?

I was wondering whether to add such tests case because the bug was in our test using incorrectly the class ... and in the type annotation but types in Python ...
Anyway, since this comes up as a request, I guess adding it was the better decision. I'll update the PR.

After the implementation of a Key class representing
the public portion of a key, the method add_key() should
take an argument of type Key, instead of a dictionary.

Test cases are updated accordingly.

Signed-off-by: Teodora Sechkova <[email protected]>
@jku
Copy link
Member

jku commented May 14, 2021

I was wondering whether to add such tests case because the bug was in our test using incorrectly the class

yeah you do have a point here -- thanks anyway.

@jku jku merged commit 9a397b9 into theupdateframework:develop May 14, 2021
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

Successfully merging this pull request may close these issues.

Metadata API: Root.add_key() is broken
2 participants