class_docstr: Test the object Wrapper mixin utility
class_docstr_tok: ["Test","the","object","Wrapper","mixin","utility"]
docstr: Test the ability to "rewrap" an object on demand
docstr_tok: ["Test","the","ability","to","``","rewrap","''","an","object","on","demand"]
code: def test_rewrap_object(self):
      """
      Test the ability to "rewrap" an object on demand
      """
      obj = WrappedEstimator()
      old = obj._wrapped
      new = mock.MagicMock(spec=GaussianNB())
  
      obj.predict()
      old.predict.assert_called_once()
      new.assert_not_called()
  
      # rewrap
      obj._wrapped = new
      obj.predict()
      old.predict.assert_called_once()
      new.predict.assert_called_once()
  
imports: import pytest
  from unittest import mock
  from yellowbrick.base import Visualizer
  from yellowbrick.utils.wrapper import *
  from yellowbrick.exceptions import YellowbrickAttributeError, YellowbrickTypeError
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.naive_bayes import GaussianNB
label_desc: Use image node_id 4 for calling the TestWrapper obj's underlying member method code with example usage: obj.test_rewrap_object() without return types