code: def test_update(self):
      data = ["a", "d"]
      locs = [0, 1]
  
      data_update = ["b", "d", "e"]
      unique_data = ["a", "d", "b", "e"]
      updated_locs = [0, 1, 2, 3]
  
      unit = cat.UnitData(data)
      assert list(unit._mapping.keys()) == data
      assert list(unit._mapping.values()) == locs
  
      unit.update(data_update)
      assert list(unit._mapping.keys()) == unique_data
      assert list(unit._mapping.values()) == updated_locs
  
imports: import warnings
  import pytest
  import numpy
  import matplotlib
  from matplotlib.axes import Axes
  import matplotlib.pyplot
  import matplotlib.category
  from matplotlib.testing.decorators import check_figures_equal
label_desc: Use image node_id 2 for calling the TestUnitData obj's underlying member method code with example usage: obj.test_update() without return types