class_docstr: Test suite for generate_discrete_swarm() method
class_docstr_tok: ["Test","suite","for","generate_discrete_swarm","(",")","method"]
docstr: Test if init_pos actually sets the position properly
docstr_tok: ["Test","if","init_pos","actually","sets","the","position","properly"]
code: def test_generate_discrete_swarm(self, init_pos):
      """Test if init_pos actually sets the position properly"""
      dims = 3
      pos = P.generate_discrete_swarm(
          n_particles=2, dimensions=dims, init_pos=init_pos
      )
      if init_pos is None:
          assert (np.max(pos, axis=1) == dims - 1).all()
      else:
          assert np.equal(pos, init_pos).all()
  
file_path: pyswarms/tests/backend/test_generators.py
imports: import numpy
  import pytest
  import pyswarms.backend
label_desc: Use image node_id 3 for calling the TestDiscreteSwarm obj's underlying member method code with example usage: obj.test_generate_discrete_swarm(init_pos) without return types