code: def test_from_hex_string(self) -> None:
      # '#rrggbb'
      c = bcc.RGB.from_hex_string("#A3B20F")
      assert (c.r, c.g, c.b, c.a) == (163, 178, 15, 1.0)
      c = bcc.RGB.from_hex_string("#a3b20f")
      assert (c.r, c.g, c.b, c.a) == (163, 178, 15, 1.0)
  
      # '#rrggbbaa'
      c = bcc.RGB.from_hex_string("#A3B20FC0")
      assert (c.r, c.g, c.b, c.a) == (163, 178, 15, 192 / 255.0)
      c = bcc.RGB.from_hex_string("#a3b20fc0")
      assert (c.r, c.g, c.b, c.a) == (163, 178, 15, 192 / 255.0)
  
      # '#rgb'
      c = bcc.RGB.from_hex_string("#7A3")
      assert (c.r, c.g, c.b, c.a) == (119, 170, 51, 1.0)
      c = bcc.RGB.from_hex_string("#7a3")
      assert (c.r, c.g, c.b, c.a) == (119, 170, 51, 1.0)
  
      # '#rgba'
      c = bcc.RGB.from_hex_string("#7A3B")
      assert (c.r, c.g, c.b, c.a) == (119, 170, 51, 187 / 255.0)
      c = bcc.RGB.from_hex_string("#7a3b")
      assert (c.r, c.g, c.b, c.a) == (119, 170, 51, 187 / 255.0)
  
      # Invalid hex string
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string("#")
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string("#1")
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string("#12")
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string("#12345")
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string("#1234567")
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string("#123456789")
      with pytest.raises(ValueError):
          bcc.RGB.from_hex_string(" #abc")
  
imports: from __future__ import annotations
  import pytest
  import bokeh.colors.color
label_desc: Use image node_id 4 for calling the Test_RGB obj's underlying member method code with example usage: obj.test_from_hex_string() without return types