def test_neighbors_filter(self):
        """Tests that a link between two nodes is bidirectional."""
        self.observable1.link_to(self.observable2, "a", "description_aaaa")
        self.observable1.link_to(self.observable3, "c", "description_ccc")

        # filter on edge description
        vertices, edges, edge_count = self.observable1.neighbors(
            filter=[GraphFilter(key="description", value="_ccc", operator="=~")]
        )
        self.assertEqual(len(vertices), 1)
        self.assertEqual(edge_count, 1)
        self.assertEqual(
            vertices[self.observable3.extended_id].value, self.observable3.value
        )

        # filter on vertice value
        vertices, edges, edge_count = self.observable1.neighbors(
            filter=[GraphFilter(key="value", value="8.8", operator="=~")]
        )
        self.assertEqual(len(vertices), 1)
        self.assertEqual(edge_count, 1)
        self.assertEqual(
            vertices[self.observable3.extended_id].value, self.observable3.value
        )

        vertices, edges, edge_count = self.observable1.neighbors()
        self.assertEqual(len(vertices), 2)
        self.assertEqual(edge_count, 2)
Tests that a link between two nodes is bidirectional.
tests/schemas/graph.py