code: def test_direction_arg(self):
      # check: PlotlyError if direction is not defined as "increasing" or
      # "decreasing" for TraceFactory.create_ohlc and
      # TraceFactory.create_candlestick
  
      kwargs = {
          "open": [1, 4],
          "high": [1, 5],
          "low": [1, 2],
          "close": [1, 2],
          "direction": ["inc"],
      }
      self.assertRaisesRegex(
          PlotlyError,
          "direction must be defined as "
          "'increasing', 'decreasing', or 'both'",
          ff.create_ohlc,
          **kwargs,
      )
      self.assertRaisesRegex(
          PlotlyError,
          "direction must be defined as "
          "'increasing', 'decreasing', or 'both'",
          ff.create_candlestick,
          **kwargs,
      )
  
      kwargs = {
          "open": [1, 2],
          "high": [1, 3],
          "low": [1, 2],
          "close": [1, 2],
          "direction": ["d"],
      }
      self.assertRaisesRegex(
          PlotlyError,
          "direction must be defined as "
          "'increasing', 'decreasing', or 'both'",
          ff.create_ohlc,
          **kwargs,
      )
      self.assertRaisesRegex(
          PlotlyError,
          "direction must be defined as "
          "'increasing', 'decreasing', or 'both'",
          ff.create_candlestick,
          **kwargs,
      )
  
imports: import math
  from unittest import TestCase
  import datetime
  import plotly.figure_factory
  import plotly.io
  from plotly.exceptions import PlotlyError
  from plotly.tests.test_optional.optional_utils import NumpyTestUtilsMixin
  from plotly.graph_objs import graph_objs
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 2 for calling the TestFinanceCharts obj's underlying member method code with example usage: obj.test_direction_arg() without return types