def test_input_graph(): temp_titan_graph = TitanFactory.build().set("storage.backend", "inmemory").open() temp_g = Gremthon(temp_titan_graph) temp_g.input_graph(graph_son_filename) assert temp_g.V.count() == 2
def test_input_graph(): temp_titan_graph = TitanFactory.build().set('storage.backend','inmemory').open() temp_g = Gremthon(temp_titan_graph) temp_g.input_graph(graph_son_filename) assert temp_g.V.count() == 2
from com.thinkaurelius.titan.core.attribute import Decimal from com.thinkaurelius.titan.graphdb.types.vertices import PropertyKeyVertex from com.thinkaurelius.titan.graphdb.types import StandardPropertyKeyMaker from com.thinkaurelius.titan.graphdb.types.vertices import EdgeLabelVertex from com.thinkaurelius.titan.graphdb.types import StandardEdgeLabelMaker from com.thinkaurelius.titan.graphdb.types import VertexLabelVertex from com.thinkaurelius.titan.graphdb.types import StandardVertexLabelMaker from com.thinkaurelius.titan.core import Cardinality from java.lang import Double, String, Integer from java.nio.file import Files graph_son_filename = os.path.join(str(Files.createTempDirectory("temp_graph_son_dir")), "graph.son") graph = TinkerGraphFactory.createTinkerGraph() titan_graph = TitanFactory.build().set("storage.backend", "inmemory").open() g = Gremthon(graph) tg = Gremthon(titan_graph) def test_gremthon_repr(): """ Verify repr of a gremthon wrapped graph """ assert str(g) == "tinkergraph[vertices:6 edges:6]" def test_gremthon_titan_repr(): """ Verify repr of a gremthon wrapped titan graph
from com.thinkaurelius.titan.core.attribute import Decimal from com.thinkaurelius.titan.graphdb.types.vertices import PropertyKeyVertex from com.thinkaurelius.titan.graphdb.types import StandardPropertyKeyMaker from com.thinkaurelius.titan.graphdb.types.vertices import EdgeLabelVertex from com.thinkaurelius.titan.graphdb.types import StandardEdgeLabelMaker from com.thinkaurelius.titan.graphdb.types import VertexLabelVertex from com.thinkaurelius.titan.graphdb.types import StandardVertexLabelMaker from com.thinkaurelius.titan.core import Cardinality from java.lang import Double, String, Integer from java.nio.file import Files graph_son_filename = os.path.join(str(Files.createTempDirectory('temp_graph_son_dir')), 'graph.son') graph = TinkerGraphFactory.createTinkerGraph() titan_graph = TitanFactory.build().set('storage.backend','inmemory').open() g = Gremthon(graph) tg = Gremthon(titan_graph) def test_gremthon_repr(): """ Verify repr of a gremthon wrapped graph """ assert str(g) == 'tinkergraph[vertices:6 edges:6]' def test_gremthon_titan_repr(): """ Verify repr of a gremthon wrapped titan graph