code: def test_color_params__get_geom2d_layer():
      spec_dict = _get_geom2d_layer(
          **_get_geom2d_layer_props(geom_kind="point")
      ).as_dict()
      assert "color" not in spec_dict
  
      spec_dict = _get_geom2d_layer(
          **_get_geom2d_layer_props(geom_kind="point", color="red")
      ).as_dict()
      assert "red" == spec_dict["color"]
  
      spec_dict = _get_geom2d_layer(
          **_get_geom2d_layer_props(geom_kind="point", color_by="red")
      ).as_dict()
      assert "color" not in spec_dict
  
      for geom_kind, aes_name, aes_def in [
          ("tile", "fill", "..count.."),
          ("density2d", "color", "..group.."),
          ("density2df", "fill", "..group.."),
      ]:
          spec_dict = _get_geom2d_layer(
              **_get_geom2d_layer_props(geom_kind=geom_kind)
          ).as_dict()
          assert "color" not in spec_dict
          assert "fill" not in spec_dict
          assert {aes_name: aes_def} == spec_dict["mapping"]
  
          spec_dict = _get_geom2d_layer(
              **_get_geom2d_layer_props(
                  geom_kind=geom_kind, color="red"
              )
          ).as_dict()
          assert "red" == spec_dict["color"]
          assert "fill" not in spec_dict
          assert {aes_name: aes_def} == spec_dict["mapping"]
  
          spec_dict = _get_geom2d_layer(
              **_get_geom2d_layer_props(
                  geom_kind=geom_kind, color_by="color"
              )
          ).as_dict()
          assert "color" not in spec_dict
          assert "fill" not in spec_dict
          assert {aes_name: "color"} == spec_dict["mapping"]
  
          spec_dict = _get_geom2d_layer(
              **_get_geom2d_layer_props(
                  geom_kind=geom_kind, color="red", color_by="color"
              )
          ).as_dict()
          assert "red" == spec_dict["color"]
          assert "fill" not in spec_dict
          assert {aes_name: "color"} == spec_dict["mapping"]
  
file_path: lets-plot/python-package/test/plot/test_bistro_common.py
imports: import pytest
  from lets_plot.bistro._plot2d_common import _get_bin_params_2d, _get_geom2d_layer, _get_marginal_layers
label_desc: Use image node_id 8 for calling a global function with example usage: test_color_params__get_geom2d_layer() without return types