Exemple #1
0
    def test_neo4j_no_nodes(self):
        with pytest.warns(RuntimeWarning):
            g = graphistry.cypher("MATCH (a) WHERE a.x = 123 RETURN a LIMIT 1")

        assert len(g._nodes) == 0
        assert len(g._edges) == 0
        for col in [node_id_key, node_type_key]:
            assert col in g._nodes
        for col in [
                start_node_id_key, end_node_id_key, relationship_id_key,
                relationship_type_key
        ]:
            assert col in g._edges
Exemple #2
0
    def test_neo4j_some_edges(self):

        g = graphistry.cypher(
            "MATCH (a)-[b]-(c) WHERE a <> c RETURN a, b, c LIMIT 1")
        assert len(g._nodes) == 2
        assert len(g._edges) == 1

        for col in [node_id_key, node_type_key]:
            assert col in g._nodes

        for col in [
                start_node_id_key, end_node_id_key, relationship_id_key,
                relationship_type_key
        ]:
            assert col in g._edges
Exemple #3
0
    def test_neo4j_ready(self):

        g = graphistry.cypher(
            "MATCH (a)-[b]-(c) WHERE a <> c RETURN a, b, c LIMIT 1")
        assert len(g._nodes) == 2