code: def _assert_raster_smaller(self, p_no_raster, p_raster):
      # Plot and check that the file sizes are smaller when
      # rastering. Then delete the files.
      geom_name = p_raster.layers[0].geom.__class__.__name__
      fn1 = Path(f"{geom_name}-no-raster.pdf")
      fn2 = Path(f"{geom_name}-raster.pdf")
  
      try:
          with pytest.warns(PlotnineWarning):
              p_no_raster.save(fn1)
              p_raster.save(fn2)
          assert fn1.stat().st_size > fn2.stat().st_size
      finally:
          fn1.unlink(missing_ok=True)
          fn2.unlink(missing_ok=True)
  
file_path: plotnine/tests/test_layers.py
imports: from pathlib import Path
  import numpy
  import pandas
  import pytest
  from plotnine import aes, geom_path, geom_point, ggplot
  from plotnine.exceptions import PlotnineError, PlotnineWarning
  from plotnine.layer import Layers, layer
label_desc: Use image node_id 1 for calling the TestRasterizing obj's underlying member method code with example usage: obj._assert_raster_smaller(p_no_raster, p_raster) without return types