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

use new-style API tokens for Jenkins >= 2.129.1 #52

Merged
merged 6 commits into from
Feb 22, 2019

Conversation

faebd7
Copy link
Contributor

@faebd7 faebd7 commented Feb 19, 2019

Addresses #47

unit_tests/stubs/apt.py Outdated Show resolved Hide resolved
lib/charms/layer/jenkins/api.py Outdated Show resolved Hide resolved
self.users = Users()

def test_configure_admin_custom_password(self):
@mock.patch('charms.layer.jenkins.packages.Packages.jenkins_version')
Copy link
Collaborator

Choose a reason for hiding this comment

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

For consistency with the approach taken to test the Api() class, I'd suggest to use the same depedency injection technique:

class Users(object):
    __init__(self, packages=None):
        self._packages = packages or Packages()

This will avoid having to add mock configuration directives like this in the future, in every possible test that indirectly uses the Users() class.

@freeekanayaka freeekanayaka merged commit b16ffd9 into jenkinsci:master Feb 22, 2019
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.

None yet

3 participants