本文整理汇总了Python中bulbs.element.VertexProxy.get方法的典型用法代码示例。如果您正苦于以下问题:Python VertexProxy.get方法的具体用法?Python VertexProxy.get怎么用?Python VertexProxy.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bulbs.element.VertexProxy
的用法示例。
在下文中一共展示了VertexProxy.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: VertexProxyTestCase
# 需要导入模块: from bulbs.element import VertexProxy [as 别名]
# 或者: from bulbs.element.VertexProxy import get [as 别名]
class VertexProxyTestCase(BulbsTestCase):
def setUp(self):
self.vertices = VertexProxy(Vertex,self.client)
def test_create(self):
james = self.vertices.create({'name':'James'})
assert isinstance(james,Vertex)
#assert type(james._id) == int
assert james._type == "vertex"
assert james.name == "James"
def test_update_and_get(self):
james1 = self.vertices.create({'name':'James'})
self.vertices.update(james1._id, {'name':'James','age':34})
james2 = self.vertices.get(james1._id)
assert james2._id == james1._id
assert james2.name == "James"
assert james2.age == 34
#def test_get_all(self):
# vertices = self.vertices.get_all()
# vertices = list(vertices)
# assert len(vertices) > 0
#def test_remove_property(self):
# query_time = self.vertices.remove(self.james._id,'age')
# assert type(query_time) == float
# assert self.james.age is None
def test_delete_vertex(self):
james = self.vertices.create({'name':'James'})
resp = self.vertices.delete(james._id)
j2 = self.vertices.get(james._id)
assert j2 == None
def test_ascii_encoding(self):
# http://stackoverflow.com/questions/19824952/unicodeencodeerror-bulbs-and-neo4j-create-model
data = {u'name': u'Aname M\xf6ller'}
v1a = self.vertices.create(data)
v1b = self.vertices.get(v1a._id)
assert v1b.name == data['name']
示例2: VertexProxyTestCase
# 需要导入模块: from bulbs.element import VertexProxy [as 别名]
# 或者: from bulbs.element.VertexProxy import get [as 别名]
class VertexProxyTestCase(BulbsTestCase):
def setUp(self):
self.vertices = VertexProxy(Vertex,self.client)
def test_create(self):
james = self.vertices.create({'name':'James'})
assert isinstance(james,Vertex)
#assert type(james._id) == int
assert james._type == "vertex"
assert james.name == "James"
def test_update_and_get(self):
james1 = self.vertices.create({'name':'James'})
self.vertices.update(james1._id, {'name':'James','age':34})
james2 = self.vertices.get(james1._id)
assert james2._id == james1._id
assert james2.name == "James"
assert james2.age == 34
#def test_get_all(self):
# vertices = self.vertices.get_all()
# vertices = list(vertices)
# assert len(vertices) > 0
#def test_remove_property(self):
# query_time = self.vertices.remove(self.james._id,'age')
# assert type(query_time) == float
# assert self.james.age is None
def test_delete_vertex(self):
james = self.vertices.create({'name':'James'})
resp = self.vertices.delete(james._id)
j2 = self.vertices.get(james._id)
assert j2 == None