code: def test_run(main=False):
      position = Position()
      comminfo = FakeCommInfo()
      order = bt.BuyOrder(
          data=FakeData(),
          size=100,
          price=1.0,
          exectype=bt.Order.Market,
          simulated=True,
      )
      order.addcomminfo(comminfo)
  
      ### Test that partially updating order will maintain correct iterpending sequence
      ### (Orders are cloned for each notification. The pending bits should be reported
      ###  related to the previous notification (clone))
  
      # Add two bits and validate we have two pending bits
      _execute(position, order, 10, 1.0, True)
      _execute(position, order, 20, 1.1, True)
  
      clone = order.clone()
      pending = clone.executed.getpending()
      assert len(pending) == 2
      assert pending[0].size == 10
      assert pending[0].price == 1.0
      assert pending[1].size == 20
      assert pending[1].price == 1.1
  
      # Add additional two bits and validate we still have two pending bits after clone
      _execute(position, order, 30, 1.2, True)
      _execute(position, order, 40, 1.3, False)
  
      clone = order.clone()
      pending = clone.executed.getpending()
      assert len(pending) == 2
      assert pending[0].size == 30
      assert pending[0].price == 1.2
      assert pending[1].size == 40
      assert pending[1].price == 1.3
  
file_path: backtrader/tests/test_order.py
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import backtrader
  from backtrader import Order, Position
label_desc: Use image node_id 2 for calling a global function with example usage: test_run(main) without return types