예제 #1
0
    def test_cert_based_auth_ca_no_cert(self, mock_delete_protected_repo):
        repo = Repository(repo_id='test')
        config = {'auth_ca': 'looks not so legit'}

        configuration.process_cert_based_auth(repo, config)

        mock_delete_protected_repo.assert_called_once_with(repo.repo_id)
예제 #2
0
    def test_cert_based_auth_ca_no_cert(self, mock_delete_protected_repo):
        repo = Repository(repo_id='test')
        config = {'auth_ca': 'looks not so legit'}

        configuration.process_cert_based_auth(repo, config)

        mock_delete_protected_repo.assert_called_once_with(repo.repo_id)
예제 #3
0
    def test_cert_based_auth_ca_and_cert(self, mock_write_consumer_cert_bundle, mock_add_protected_repo):
        repo = Repository(repo_id="test")
        config = {"auth_ca": "looks legit", "auth_cert": "1234567890"}
        bundle = {"ca": config["auth_ca"], "cert": config["auth_cert"]}

        configuration.process_cert_based_auth(repo, config)

        mock_write_consumer_cert_bundle.assert_called_once_with(repo.repo_id, bundle)
        mock_add_protected_repo.assert_called_once_with(repo.repo_id, repo.repo_id)
    def test_cert_based_auth_ca_and_cert(self, mock_write_consumer_cert_bundle, mock_add_protected_repo):
        repo = Repository('test')
        config = {'auth_ca': 'looks legit',
                  'auth_cert': '1234567890'}
        bundle = {'ca': config['auth_ca'], 'cert': config['auth_cert']}

        configuration.process_cert_based_auth(repo, config)

        mock_write_consumer_cert_bundle.assert_called_once_with(repo.id, bundle)
        mock_add_protected_repo.assert_called_once_with(repo.id, repo.id)
예제 #5
0
    def test_cert_based_auth_ca_and_cert(self, mock_write_consumer_cert_bundle,
                                         mock_add_protected_repo):
        repo = Repository('test')
        config = {'auth_ca': 'looks legit',
                  'auth_cert': '1234567890'}
        bundle = {'ca': config['auth_ca'], 'cert': config['auth_cert']}

        configuration.process_cert_based_auth(repo, config)

        mock_write_consumer_cert_bundle.assert_called_once_with(repo.id, bundle)
        mock_add_protected_repo.assert_called_once_with(repo.id, repo.id)
예제 #6
0
    def test_cert_based_auth_no_ca_no_cert(self, mock_delete_protected_repo):
        repo = Repository(repo_id='test')

        configuration.process_cert_based_auth(repo, {})

        mock_delete_protected_repo.assert_called_once_with(repo.repo_id)
예제 #7
0
    def test_cert_based_auth_no_ca_no_cert(self, mock_delete_protected_repo):
        repo = Repository(repo_id='test')

        configuration.process_cert_based_auth(repo, {})

        mock_delete_protected_repo.assert_called_once_with(repo.repo_id)