當前位置: 首頁>>代碼示例>>Python>>正文


Python Connection.make_connection方法代碼示例

本文整理匯總了Python中marklogic.connection.Connection.make_connection方法的典型用法代碼示例。如果您正苦於以下問題:Python Connection.make_connection方法的具體用法?Python Connection.make_connection怎麽用?Python Connection.make_connection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在marklogic.connection.Connection的用法示例。


在下文中一共展示了Connection.make_connection方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_load

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_load(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        server = HttpServer("Manage", "Default")
        self.assertEqual(server.server_name(), "Manage")
        self.assertIsNotNone(server.read(connection))
        self.assertEqual("http", server.server_type())
開發者ID:Annakan,項目名稱:python_api,代碼行數:9,代碼來源:test_server.py

示例2: test_list

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_list(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        names = Role.list(connection)

        self.assertGreater(len(names), 65)
        self.assertIn("admin", names)
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:9,代碼來源:test_role.py

示例3: test_create

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_create(self):
        pem = ("-----BEGIN CERTIFICATE-----\n"
               "MIIC3TCCAkYCCQCJtpKDQbobyTANBgkqhkiG9w0BAQsFADCBsjELMAkGA1UEBhMC\n"
               "VVMxCzAJBgNVBAgMAlRYMQ8wDQYDVQQHDAZBdXN0aW4xHjAcBgNVBAoMFU1hcmtM\n"
               "b2dpYyBDb3Jwb3JhdGlvbjEXMBUGA1UECwwOVFggRW5naW5lZXJpbmcxITAfBgNV\n"
               "BAMMGE1hcmtMb2dpYyBUWCBFbmdpbmVlcmluZzEpMCcGCSqGSIb3DQEJARYabm9y\n"
               "bWFuLndhbHNoQG1hcmtsb2dpYy5jb20wHhcNMTQwODI3MTkyMzQyWhcNMTUwODI3\n"
               "MTkyMzQyWjCBsjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAlRYMQ8wDQYDVQQHDAZB\n"
               "dXN0aW4xHjAcBgNVBAoMFU1hcmtMb2dpYyBDb3Jwb3JhdGlvbjEXMBUGA1UECwwO\n"
               "VFggRW5naW5lZXJpbmcxITAfBgNVBAMMGE1hcmtMb2dpYyBUWCBFbmdpbmVlcmlu\n"
               "ZzEpMCcGCSqGSIb3DQEJARYabm9ybWFuLndhbHNoQG1hcmtsb2dpYy5jb20wgZ8w\n"
               "DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAJSo3wFMDvTV7Q+4NDDMu9aJZ6uK4l8b\n"
               "ACIk5/Ug+MoST+CuIfeBlb2Y6dxNCwkADwVPpykslDcHYFygxFIcnHHVhgqZ0xzu\n"
               "LPXBagXmHyj+mb6im1tkbqAxQ7gj/SDeCnQYRIwNRlGgWZJFViaYJH3CC8G/f16F\n"
               "IhDyQS3h28W3AgMBAAEwDQYJKoZIhvcNAQELBQADgYEAWbidV4huPlf8Ac0c3Cbs\n"
               "Nx2xogODSjNPKqwug0Y3jKx33uxeY7i9oParWSnVFkG0JYUZEfrO5fmtS6JSA1Lk\n"
               "e3BioC9xgclEYFiDoZSARasL8hdNvu7v+EYZEnS43rR4M7CQiq/Tf50o4VjiVM9S\n"
               "I0Bo+VZSaShQKipBEHS8sP8=\n"
               "-----END CERTIFICATE-----\n")

        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        cert = Authority.create(connection, pem)

        self.assertIsNotNone(cert)
        self.assertEqual('true', cert.enabled())
        self.assertIsNotNone(cert.properties())

        cert.delete(connection)
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:31,代碼來源:test_authorities.py

示例4: test_lookup

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_lookup(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        role = Role.lookup(connection, "admin")

        self.assertIsNotNone(role)
        self.assertEqual(role.role_name(), "admin")
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:9,代碼來源:test_role.py

示例5: test_list

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_list(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        privileges = Privilege.list(connection)

        self.assertGreater(len(privileges), 300)
        self.assertIn("execute|manage-admin", privileges)
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:9,代碼來源:test_privilege.py

示例6: test_template

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_template(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        req = Request(countryName="US", stateOrProvinceName="TX",
                      localityName="Austin", organizationName="MarkLogic",
                      emailAddress="[email protected]",
                      version=0)
        temp = Template("Test Template", "Test description", req)

        self.assertEqual("Test Template", temp.template_name())

        temp.create(connection)

        names = Template.list(connection)

        self.assertGreater(len(names), 0)
        self.assertIn(temp.template_id(), names)

        temp.set_template_name("New Name")
        temp.set_template_description("New Description")
        temp.update(connection)
        self.assertIsNotNone(temp)

        newtemp = Template.lookup(connection, temp.template_id())
        self.assertEqual(temp.template_name(), newtemp.template_name())

        temp.delete(connection)

        self.assertIsNotNone(temp)
開發者ID:Annakan,項目名稱:python_api,代碼行數:31,代碼來源:test_cert_templates.py

示例7: test_lookup

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_lookup(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        user = User.lookup(connection, "nobody")

        self.assertIsNotNone(user)
        self.assertEqual(user.user_name(), "nobody")
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:9,代碼來源:test_user.py

示例8: test_lookup

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_lookup(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        privilege = Privilege.lookup(connection, "manage-admin", "execute")

        self.assertIsNotNone(privilege)
        self.assertEqual(privilege.privilege_name(), "manage-admin")
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:9,代碼來源:test_privilege.py

示例9: test_list

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_list(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        users = User.list(connection)

        self.assertGreater(len(users), 2)
        self.assertIn("nobody", users)
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:9,代碼來源:test_user.py

示例10: test_lookup

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_lookup(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        server = Server.lookup(connection, "Manage")

        self.assertIsNotNone(server)
        self.assertEqual(server.server_name(), "Manage")
開發者ID:Annakan,項目名稱:python_api,代碼行數:9,代碼來源:test_server.py

示例11: test_lookup_action

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_lookup_action(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        privilege = Privilege.lookup(connection, kind="execute", \
          action="http://marklogic.com/xdmp/privileges/admin-module-write")

        self.assertIsNotNone(privilege)
        self.assertEqual(privilege.privilege_name(), "admin-module-write")
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:10,代碼來源:test_privilege.py

示例12: test_lookup

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_lookup(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        names = Authority.list(connection)
        auth = Authority.lookup(connection, names[0])

        self.assertIsNotNone(auth)
        self.assertEqual(auth.certificate_id(), names[0])
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:10,代碼來源:test_authorities.py

示例13: _test_ssl_certificate_pems

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def _test_ssl_certificate_pems(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)
        server = HttpServer("foo-http", "Default", 10101, '/', 'Documents')
        self.assertEqual(server.server_name(), "foo-http")
        server.create(connection)
        self.assertIsNotNone(server)
        self.assertEqual("http", server.server_type())

        pem1 = "-----BEGIN CERTIFICATE-----\n\
MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc\n\
MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT\n\
ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw\n\
MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j\n\
LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ\n\
KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo\n\
RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu\n\
WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw\n\
Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD\n\
AQH/MB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kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA\n\
A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA\n\
Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv\n\
8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV\n\
-----END CERTIFICATE-----"

        server.add_ssl_client_certificate_pem(pem1)
        server.update(connection)
        server.read(connection)

        self.assertEqual(1, len(server.ssl_client_certificate_pems()))

        server.set_ssl_client_certificate_pems([pem1,pem2])
        server.update(connection)
        server.read(connection)

        self.assertEqual(2, len(server.ssl_client_certificate_pems()))

        server.delete(connection)
        server = Server.lookup(connection, "foo-http")
        self.assertIsNone(server)
開發者ID:Annakan,項目名稱:python_api,代碼行數:59,代碼來源:test_server.py

示例14: test_create_webdav_server

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
 def test_create_webdav_server(self):
     connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)
     server = WebDAVServer("foo-webdav", "Default", 10101, '/', 'Documents')
     self.assertEqual(server.server_name(), "foo-webdav")
     server.create(connection)
     self.assertIsNotNone(server)
     self.assertEqual("webdav", server.server_type())
     server.delete(connection)
     server = Server.lookup(connection, "foo-webdav")
     self.assertIsNone(server)
開發者ID:Annakan,項目名稱:python_api,代碼行數:12,代碼來源:test_server.py

示例15: test_list

# 需要導入模塊: from marklogic.connection import Connection [as 別名]
# 或者: from marklogic.connection.Connection import make_connection [as 別名]
    def test_list(self):
        connection = Connection.make_connection(tc.hostname, tc.admin, tc.password)

        names = Authority.list(connection, include_names=True)

        self.assertGreater(len(names), 100)
        found = False
        for name in names:
            found = found or "Equifax" in name
        self.assertEqual(True, found)
開發者ID:ndw,項目名稱:python_api_TEMP,代碼行數:12,代碼來源:test_authorities.py


注:本文中的marklogic.connection.Connection.make_connection方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。