code: def test_patch():
      fig, ax = plt.subplots()
      ax.add_patch(
          plt.Rectangle(
              (0, 0),
              1,
              2,
              alpha=0.2,
              linewidth=2,
              edgecolor="green",
              facecolor="red",
              zorder=3,
          )
      )
      rep = fig_to_dict(fig)
      axrep = rep["axes"][0]
      path = axrep["paths"][0]
  
      assert_equal(
          list(sorted(path.keys())),
          [
              "alpha",
              "coordinates",
              "dasharray",
              "data",
              "edgecolor",
              "edgewidth",
              "facecolor",
              "id",
              "pathcodes",
              "xindex",
              "yindex",
              "zorder",
          ],
      )
  
      assert_equal(path["alpha"], 0.2)
      assert_equal(path["edgecolor"], "rgba(0, 128, 0, 0.2)")
      assert_equal(path["facecolor"], "rgba(255, 0, 0, 0.2)")
      assert_equal(path["edgewidth"], 2)
      assert_equal(path["zorder"], 3)
  
file_path: mpld3/mpld3/tests/test_elements.py
imports: import numpy
  import matplotlib.pyplot
  from ..None import fig_to_dict, fig_to_html
  from numpy.testing import assert_equal
label_desc: Use image node_id 4 for calling a global function with example usage: test_patch() without return types