code: def testVolumeLimitPerBar(self):
      volume = 100
      self.strategy.onBars(
          None, self.barsBuilder.nextBars(11, 12, 4, 9, volume)
      )
      self.assertEquals(
          self.strategy.getVolumeLeft()[BaseTestCase.TestInstrument], 25
      )
      self.assertEquals(
          self.strategy.getVolumeUsed()[BaseTestCase.TestInstrument], 0
      )
  
      self.strategy.onOrderFilled(
          None, self.__getFilledMarketOrder(24, 11)
      )
      self.assertEquals(
          self.strategy.getVolumeLeft()[BaseTestCase.TestInstrument], 1
      )
      self.assertEquals(
          self.strategy.getVolumeUsed()[BaseTestCase.TestInstrument], 24
      )
  
      with self.assertRaisesRegexp(
          Exception,
          "Invalid fill quantity 25. Not enough volume left 1",
      ):
          self.strategy.onOrderFilled(
              None, self.__getFilledMarketOrder(25, 11)
          )
      self.assertEquals(
          self.strategy.getVolumeLeft()[BaseTestCase.TestInstrument], 1
      )
      self.assertEquals(
          self.strategy.getVolumeUsed()[BaseTestCase.TestInstrument], 24
      )
  
file_path: pyalgotrade/testcases/fill_strategy_test.py
imports: import unittest
  import datetime
  from .None import broker_backtesting_test
  from pyalgotrade import broker
  from pyalgotrade.broker import fillstrategy
  from pyalgotrade.broker import backtesting
  from pyalgotrade import bar
label_desc: Use image node_id 3 for calling the DefaultStrategyTestCase obj's underlying member method code with example usage: obj.testVolumeLimitPerBar() without return types