code: def test_defaults_in_constructor(self):
      fig = go.Figure(
          layout={
              "template": {"layout": {"imagedefaults": {"sizex": 500}}}
          }
      )
  
      self.assertEqual(
          fig.layout.template.layout.imagedefaults,
          go.layout.Image(sizex=500),
      )
  
      self.assertEqual(
          fig.to_dict(),
          {
              "data": [],
              "layout": {
                  "template": {
                      "layout": {"imagedefaults": {"sizex": 500}}
                  }
              },
          },
      )
  
imports: import copy
  from unittest import TestCase
  import pytest
  import plotly.io
  import plotly.graph_objs
  from plotly.tests.utils import TestCaseNoTemplate
label_desc: Use image node_id 6 for calling the TemplateTest obj's underlying member method code with example usage: obj.test_defaults_in_constructor() without return types