code: def testToDirectedInvalidMode(self):
      graph = Graph([(0, 1), (0, 2), (2, 3), (2, 4)], directed=False)
      with self.assertRaises(ValueError):
          graph.to_directed("no-such-mode")
  
file_path: python-igraph/tests/test_conversion.py
imports: import random
  import unittest
  from igraph import Graph, Matrix
label_desc: Use image node_id 6 for calling the DirectedUndirectedTests obj's underlying member method code with example usage: obj.testToDirectedInvalidMode() without return types