docstr: Test this the buffer with different underlying buffers.
  
  Test if we can initialize a simple underlying buffer without
  additional arguments and lockstep sampling.
docstr_tok: ["Test","this","the","buffer","with","different","underlying","buffers",".","Test","if","we","can","initialize","a","simple","underlying","buffer","without","additional","arguments","and","lockstep","sampling","."]
code: def test_lockstep_with_underlying_replay_buffer(self):
      """Test this the buffer with different underlying buffers.
  
      Test if we can initialize a simple underlying buffer without
      additional arguments and lockstep sampling.
      """
      # Test with ReplayBuffer, no args for c'tor, add and sample
      replay_buffer_config = {"type": ReplayBuffer}
  
      num_policies = 2
      buffer_size = 200
      num_batches = 20
  
      buffer = MultiAgentReplayBuffer(
          capacity=buffer_size,
          replay_mode="lockstep",
          num_shards=1,
          underlying_buffer_config=replay_buffer_config,
      )
  
      self._add_multi_agent_batch_to_buffer(
          buffer, num_policies=num_policies - 1, num_batches=num_batches
      )
  
      # Only test if we can sample and if samples belong to a single policy
      sample = buffer.sample(2)
      assert len(sample) == 2
      assert len(sample.policy_batches) == 1
  
      self._add_multi_agent_batch_to_buffer(
          buffer, num_policies=num_policies, num_batches=num_batches
      )
  
      # Only test if we can sample from multiple policies, out of 100
      # samples, some should be of each policy
      sample = buffer.sample(100)
      assert len(sample) == 100
      assert len(sample.policy_batches) == 2
  
file_path: ray/rllib/utils/replay_buffers/tests/test_multi_agent_replay_buffer.py
imports: import unittest
  import numpy
  from ray.rllib.policy.sample_batch import SampleBatch, MultiAgentBatch, concat_samples
  from ray.rllib.policy.sample_batch import DEFAULT_POLICY_ID
  from ray.rllib.utils.replay_buffers.multi_agent_replay_buffer import MultiAgentReplayBuffer
  from ray.rllib.utils.replay_buffers.prioritized_replay_buffer import PrioritizedReplayBuffer
  from ray.rllib.utils.replay_buffers.replay_buffer import ReplayBuffer
label_desc: Use image node_id 7 for calling the TestMultiAgentReplayBuffer obj's underlying member method code with example usage: obj.test_lockstep_with_underlying_replay_buffer() without return types