# Path: tests/utils.py
# def temporary_file(content=None, mode=None, binary=False):


import unittest
    import numpy as np
from igraph import Graph, Vertex, VertexSeq
from .utils import is_pypy
    def testIncident(self):
        g = Graph.Famous("petersen")
        g.to_directed()

        method_table = {"all": "all_edges", "in": "in_edges", "out": "out_edges"}

        for i in range(g.vcount()):
            vertex = g.vs[i]
            for mode, method_name in list(method_table.items()):
                method = getattr(vertex, method_name)
                self.assertEqual(
                    g.incident(i, mode=mode),
                    [edge.index for edge in vertex.incident(mode=mode)],
                )
                self.assertEqual(
                    g.incident(i, mode=mode), [edge.index for edge in method()]
                )

    def testNeighbors(self):
        g = Graph.Famous("petersen")
        g.to_directed()

        for i in range(g.vcount()):
            vertex = g.vs[i]
            for mode in "all in out".split():
                self.assertEqual(
                    g.neighbors(i, mode=mode),
                    [edge.index for edge in vertex.neighbors(mode=mode)],
                )


# Path: tests/utils.py
# def temporary_file(content=None, mode=None, binary=False):


# Path: tests/test_vertexseq.py
import unittest
    import numpy as np
from igraph import Graph, Vertex, VertexSeq
from .utils import is_pypy

    def testIncident(self):
        g = Graph.Famous("petersen")
        g.to_directed()

        method_table = {"all": "all_edges", "in": "in_edges", "out": "out_edges"}

        for i in range(g.vcount()):
            vertex = g.vs[i]
            for mode, method_name in list(method_table.items()):
                method = getattr(vertex, method_name)
                self.assertEqual(
                    g.incident(i, mode=mode),
                    [edge.index for edge in vertex.incident(mode=mode)],
                )
                self.assertEqual(
                    g.incident(i, mode=mode), [edge.index for edge in method()]
                )

    def testNeighbors(self):
        g = Graph.Famous("petersen")
        g.to_directed()

        for i in range(g.vcount()):
            vertex = g.vs[i]
            for mode in "all in out".split():
                self.assertEqual(
                    g.neighbors(i, mode=mode),
                    [edge.index for edge in vertex.neighbors(mode=mode)],
                )


    @unittest.skipIf(is_pypy, "skipped on PyPy because we do not have access to docstrings")