code: def test_ratio_with_one_variable(df_enc):
      # test case 1: 1 variable, ratio
      encoder = PRatioEncoder(
          encoding_method="ratio", variables=["var_A"]
      )
      encoder.fit(df_enc[["var_A", "var_B"]], df_enc["target"])
      X = encoder.transform(df_enc[["var_A", "var_B"]])
  
      # transformed dataframe
      transf_df = df_enc.copy()
      transf_df["var_A"] = [
          0.49999999999999994,
          0.49999999999999994,
          0.49999999999999994,
          0.49999999999999994,
          0.49999999999999994,
          0.49999999999999994,
          0.25,
          0.25,
          0.25,
          0.25,
          0.25,
          0.25,
          0.25,
          0.25,
          0.25,
          0.25,
          1.0,
          1.0,
          1.0,
          1.0,
      ]
  
      # init params
      assert encoder.encoding_method == "ratio"
      assert encoder.variables == ["var_A"]
      # fit params
      assert encoder.variables_ == ["var_A"]
      assert encoder.encoder_dict_ == {
          "var_A": {"A": 0.49999999999999994, "B": 0.25, "C": 1.0}
      }
      assert encoder.n_features_in_ == 2
      # transform params
      pd.testing.assert_frame_equal(X, transf_df[["var_A", "var_B"]])
  
file_path: feature_engine/tests/test_encoding/test_probability_ratio_encoder.py
imports: import pandas
  import pytest
  from feature_engine.encoding import PRatioEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: test_ratio_with_one_variable(df_enc) without return types