code: def test_parameter_checking(self):
      g = create_test_graph()
      bfw = SampledBreadthFirstWalk(g)
  
      nodes = g.node_ids_to_ilocs(["0", 1])
      n = 1
      n_size = [1]
  
      with pytest.raises(ValueError):
          # nodes should be a list of node ids even for a single node
          bfw.run(nodes=None, n=n, n_size=n_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=0, n=n, n_size=n_size)
  
      # n has to be positive integer
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=-1, n_size=n_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=10.1, n_size=n_size)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=0, n_size=n_size)
  
      # n_size has to be list of positive integers
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, n_size=0)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, n_size=[-5])
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=-1, n_size=[2.4])
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, n_size=(1, 2))
      # seed must be positive integer or 0
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, n_size=n_size, seed=-1235)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, n_size=n_size, seed=10.987665)
      with pytest.raises(ValueError):
          bfw.run(nodes=nodes, n=n, n_size=n_size, seed=-982.4746)
      with pytest.raises(ValueError):
          bfw.run(
              nodes=nodes, n=n, n_size=n_size, seed="don't be random"
          )
  
      # If no neighbours are sampled, then just the start node should be returned, e.g.:
      # subgraph = bfw.run(nodes=["0"], n=1, n_size=[])
      # assert len(subgraph) == 1
      # assert len(subgraph[0]) == 1
      # assert subgraph[0][0] == "0"
      # However, by consensus this is an error:
      with pytest.raises(ValueError):
          bfw.run(nodes=["0"], n=1, n_size=[])
  
      # 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 = bfw.run(nodes=nodes, n=n, n_size=n_size)
      assert len(subgraph) == 0
  
file_path: stellargraph/tests/data/test_breadth_first_walker.py
imports: import pandas
  import pytest
  import numpy
  from stellargraph.data.explorer import SampledBreadthFirstWalk
  from stellargraph.core.graph import StellarGraph, StellarDiGraph
  from ..test_utils.graphs import create_test_graph, tree_graph, example_graph_random, weighted_tree
label_desc: Use image node_id 1 for calling the TestBreadthFirstWalk obj's underlying member method code with example usage: obj.test_parameter_checking() without return types