code: def test_block():
      m = pyo.ConcreteModel()
      m.b = OmltBlock()
      m.b._setup_inputs_outputs(
          input_indexes=["A", "B", "C"], output_indexes=[1, 4]
      )
      m.b2 = OmltBlock()
      m.b2._setup_inputs_outputs(
          input_indexes=[(1, 3), (42, 1975), (13, 2)],
          output_indexes=[(0, 0), (0, 1), (1, 0), (1, 1)],
      )
  
      assert [k for k in m.b.inputs] == ["A", "B", "C"]
      assert [k for k in m.b.outputs] == [1, 4]
      assert [k for k in m.b2.inputs] == [(1, 3), (42, 1975), (13, 2)]
      assert [k for k in m.b2.outputs] == [
          (0, 0),
          (0, 1),
          (1, 0),
          (1, 1),
      ]
  
      m = pyo.ConcreteModel()
      m.b = OmltBlock()
      formulation = dummy_formulation()
      m.b.build_formulation(formulation)
      print(dir(m.b))
      assert m.b._OmltBlockData__formulation is formulation
      assert [k for k in m.b.inputs] == ["A", "C", "D"]
      assert [k for k in m.b.outputs] == [
          (0, 0),
          (0, 1),
          (1, 0),
          (1, 1),
      ]
  
file_path: OMLT/tests/test_block.py
imports: import pyomo.environ
  import pytest
  from omlt import OmltBlock
label_desc: Use image node_id 1 for calling a global function with example usage: test_block() without return types