class_docstr: Test class for the Folium library.
class_docstr_tok: ["Test","class","for","the","Folium","library","."]
docstr: Test to make sure that Choropleth function doesn't allow
  values outside of the domain defined by bins.
  
  It also tests that all parameters work as expected regarding
  nan and missing values.
docstr_tok: ["Test","to","make","sure","that","Choropleth","function","does","n't","allow","values","outside","of","the","domain","defined","by","bins",".","It","also","tests","that","all","parameters","work","as","expected","regarding","nan","and","missing","values","."]
code: def test_choropleth_features(self):
      """Test to make sure that Choropleth function doesn't allow
      values outside of the domain defined by bins.
  
      It also tests that all parameters work as expected regarding
      nan and missing values.
      """
      with open(os.path.join(rootpath, "us-counties.json")) as f:
          geo_data = json.load(f)
      data = {"1001": -1}
      fill_color = "BuPu"
      key_on = "id"
  
      with pytest.raises(ValueError):
          Choropleth(
              geo_data=geo_data,
              data=data,
              key_on=key_on,
              fill_color=fill_color,
              bins=[0, 1, 2, 3],
          ).add_to(self.m)
          self.m._parent.render()
  
      Choropleth(
          geo_data=geo_data,
          data={"1001": 1, "1003": float("nan")},
          key_on=key_on,
          fill_color=fill_color,
          fill_opacity=0.543212345,
          nan_fill_color="a_random_color",
          nan_fill_opacity=0.123454321,
      ).add_to(self.m)
  
      out = self.m._parent.render()
      out_str = "".join(out.split())
      assert (
          '"fillColor":"a_random_color","fillOpacity":0.123454321'
          in out_str
      )
      assert '"fillOpacity":0.543212345' in out_str
  
imports: import json
  import os
  import branca.element
  import geopandas
  import jinja2
  import numpy
  import pandas
  import pytest
  import xyzservices.providers
  from jinja2 import Environment, PackageLoader
  from jinja2.utils import htmlsafe_json_dumps
  import folium
  from folium import TileLayer
  from folium.features import Choropleth, GeoJson
label_desc: Use image node_id 8 for calling the TestFolium obj's underlying member method code with example usage: obj.test_choropleth_features() without return types