code: def test_parameter_checking(self):
      g = create_test_graph()
      urw = UniformRandomWalk(g)
  
      nodes = ["0"]
      n = 1
      length = 2
      seed = None
  
      # nodes should be a list of node ids even for a single node
      with pytest.raises(ValueError):
          urw.run(nodes=None, n=n, length=length, seed=seed)
      with pytest.raises(ValueError):
          urw.run(
              nodes="0", n=n, length=length, seed=seed
          )  # can't just pass a node id, need list, e.g., ["0"]
      # n has to be positive integer
      with pytest.raises(ValueError):
          urw.run(nodes=nodes, n=0, length=length, seed=seed)
      with pytest.raises(ValueError):
          urw.run(nodes=nodes, n=-121, length=length, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=21.4, length=length, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=-0.5, length=length, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=0.0001, length=length, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n="2", length=length, seed=seed)
  
      # length has to be positive integer
      with pytest.raises(ValueError):
          urw.run(nodes=nodes, n=n, length=0, seed=seed)
      with pytest.raises(ValueError):
          urw.run(nodes=nodes, n=n, length=-5, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=n, length=11.9, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=n, length=-9.9, seed=seed)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=n, length="10", seed=seed)
  
      # seed has to be None, 0,  or positive integer
      with pytest.raises(ValueError):
          urw.run(nodes=nodes, n=n, length=length, seed=-1)
      with pytest.raises(TypeError):
          urw.run(nodes=nodes, n=n, length=length, seed=1010.8)
  
      # If no root nodes are given, an empty list is returned which is not an error but I thought this method
      # is the best for checking this behaviour.
      nodes = []
      subgraph = urw.run(nodes=nodes, n=n, length=length, seed=None)
      assert len(subgraph) == 0
  
file_path: stellargraph/tests/data/test_uniform_random_walker.py
imports: import pytest
  import numpy
  from stellargraph.data.explorer import UniformRandomWalk
  from ..test_utils.graphs import create_test_graph, example_graph_random
label_desc: Use image node_id 1 for calling the TestUniformRandomWalk obj's underlying member method code with example usage: obj.test_parameter_checking() without return types