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

Bugfix/delete settings meta #2254

Merged
merged 3 commits into from Aug 11, 2019

Conversation

forslund
Copy link
Collaborator

Description

Fixes the incorrect variable name reported by @cclauss
This PR also adds a couple of simple unittests for these methods and does a bit of simplification of the api tests.

How to test

Check that the unittests passes.

Contributor license agreement signed?

CLA [ Yes ]

change from the old uuid to the newer skill_gid fixing the invalid
reference to skill_gid.
@devs-mycroft devs-mycroft added the CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) label Aug 10, 2019
Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

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

LGTM... Some optional optimizations.

mock_identity = mock.MagicMock()
mock_identity.is_expired.return_value = False
mock_identity.uuid = '1234'
mock_identity_get.return_value = mock_identity
Copy link
Contributor

Choose a reason for hiding this comment

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

4 lines —> 1 line: mock_identity_get.return_value = create_identity('1234')

mock_identity = mock.MagicMock()
mock_identity.is_expired.return_value = False
mock_identity.uuid = '1234'
mock_identity_get.return_value = mock_identity
Copy link
Contributor

Choose a reason for hiding this comment

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

4 lines —> 1 line: mock_identity_get.return_value = create_identity('1234')

mock_identity = mock.MagicMock()
mock_identity.is_expired.return_value = False
mock_identity.uuid = '1234'
mock_identity_get.return_value = mock_identity
Copy link
Contributor

Choose a reason for hiding this comment

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

4 lines —> 1 line: mock_identity_get.return_value = create_identity('1234')

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, totally missed replacing in the new tests.

- remove duplicated code for creating identity mock
- separate the Api class tests from the rest of the tests
@forslund forslund merged commit bbd8bf9 into MycroftAI:dev Aug 11, 2019
@forslund forslund deleted the bugfix/delete-settings-meta branch August 11, 2019 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) Type: Bug - complex
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants