harbor/tests/apitests/python/test_ldap_ping.py
stonezdj 41a574e55c Fix issue 6450 Test LDAP server error without save configuration
Signed-off-by: stonezdj <stonezdj@gmail.com>
2019-04-18 14:24:21 +08:00

41 lines
1.0 KiB
Python

# coding: utf-8
"""
Harbor API
These APIs provide services for manipulating Harbor project.
OpenAPI spec version: 1.4.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
sys.path.append(os.environ["SWAGGER_CLIENT_PATH"])
import unittest
import testutils
from swagger_client.models.ldap_conf import LdapConf
from pprint import pprint
#Testcase
# Define a LDAP group with harbor admin
class TestLdapPing(unittest.TestCase):
"""AccessLog unit test stubs"""
product_api = testutils.GetProductApi("admin", "Harbor12345")
project_id = 0
def setUp(self):
pass
def tearDown(self):
pass
def testLdapPing(self):
"""Test LdapAdminRole"""
result = self.product_api.ldap_ping_post(ldapconf=LdapConf(ldap_url="10.161.127.236", ldap_search_dn="cn=admin,dc=example,dc=com", ldap_search_password="admin", ldap_scope=2))
pprint(result)
if __name__ == '__main__':
unittest.main()