code: def testOneBarReturn(self):
      initialCash = 1000
      barFeed = yahoofeed.Feed()
      barFeed.setBarFilter(
          csvfeed.DateRangeFilter(
              datetime.datetime(2001, 12, 7),
              datetime.datetime(2001, 12, 7),
          )
      )
      barFeed.addBarsFromCSV(
          AnalyzerTestCase.TestInstrument,
          common.get_data_file_path("orcl-2001-yahoofinance.csv"),
      )
      strat = strategy_test.TestStrategy(barFeed, initialCash)
  
      # 2001-12-07,15.74,15.95,15.55,15.91,42463200,15.56
      # Manually place the orders to get them filled on the first (and only) bar.
      order = strat.getBroker().createMarketOrder(
          broker.Order.Action.BUY,
          AnalyzerTestCase.TestInstrument,
          1,
          False,
      )  # Open: 15.74
      strat.getBroker().submitOrder(order)
      order = strat.getBroker().createMarketOrder(
          broker.Order.Action.SELL,
          AnalyzerTestCase.TestInstrument,
          1,
          True,
      )  # Close: 15.91
      strat.getBroker().submitOrder(order)
  
      stratAnalyzer = returns.Returns()
      strat.attachAnalyzer(stratAnalyzer)
      strat.run()
      self.assertTrue(
          strat.getBroker().getCash() == initialCash + (15.91 - 15.74)
      )
  
      finalValue = 1000 - 15.74 + 15.91
      rets = (finalValue - initialCash) / float(initialCash)
      self.assertEqual(stratAnalyzer.getReturns()[-1], rets)
  
imports: import datetime
  from .None import common
  from .None import strategy_test
  from .None import position_test
  from testcases import test_strategy
  from pyalgotrade.barfeed import yahoofeed
  from pyalgotrade.barfeed import csvfeed
  from pyalgotrade.stratanalyzer import returns
  from pyalgotrade import broker
  from pyalgotrade import marketsession
label_desc: Use image node_id 1 for calling the AnalyzerTestCase obj's underlying member method code with example usage: obj.testOneBarReturn() without return types