本文整理汇总了Python中pyorient.messages.connection.ConnectMessage.close方法的典型用法代码示例。如果您正苦于以下问题:Python ConnectMessage.close方法的具体用法?Python ConnectMessage.close怎么用?Python ConnectMessage.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyorient.messages.connection.ConnectMessage
的用法示例。
在下文中一共展示了ConnectMessage.close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_db_exists
# 需要导入模块: from pyorient.messages.connection import ConnectMessage [as 别名]
# 或者: from pyorient.messages.connection.ConnectMessage import close [as 别名]
def test_db_exists(self):
connection = OrientSocket( "localhost", 2424 )
msg = ConnectMessage( connection )
print("%r" % msg.get_protocol())
assert msg.get_protocol() != -1
session_id = msg.prepare( ("admin", "admin") )\
.send().fetch_response()
print("Sid: %s" % session_id)
assert session_id == connection.session_id
assert session_id != -1
db_name = "GratefulDeadConcerts"
# params = ( db_name, STORAGE_TYPE_MEMORY )
params = ( db_name, STORAGE_TYPE_PLOCAL )
msg = DbExistsMessage( connection )
exists = msg.prepare( params ).send().fetch_response()
assert exists is True
msg.close()
print("%r" % exists)
示例2: test_connection
# 需要导入模块: from pyorient.messages.connection import ConnectMessage [as 别名]
# 或者: from pyorient.messages.connection.ConnectMessage import close [as 别名]
def test_connection(self):
connection = OrientSocket( "localhost", 2424 )
msg = ConnectMessage( connection )
print("%r" % msg.get_protocol())
assert msg.get_protocol() != -1
session_id = msg.prepare( ("admin", "admin") )\
.send().fetch_response()
"""
alternative use
session_id = msg.set_user("admin").set_pass("admin").prepare()\
.send().fetch_response()
"""
assert session_id == connection.session_id
assert session_id != -1
msg.close()
print("%r" % msg._header)
print("%r" % session_id)