code: def test_add_prefix_suffix(string_series):
      with_prefix = string_series.add_prefix("foo#")
      expected = Index([f"foo#{c}" for c in string_series.index])
      tm.assert_index_equal(with_prefix.index, expected)
  
      with_suffix = string_series.add_suffix("#foo")
      expected = Index([f"{c}#foo" for c in string_series.index])
      tm.assert_index_equal(with_suffix.index, expected)
  
      with_pct_prefix = string_series.add_prefix("%")
      expected = Index([f"%{c}" for c in string_series.index])
      tm.assert_index_equal(with_pct_prefix.index, expected)
  
      with_pct_suffix = string_series.add_suffix("%")
      expected = Index([f"{c}%" for c in string_series.index])
      tm.assert_index_equal(with_pct_suffix.index, expected)
  
imports: import pytest
  from pandas import Index
  import pandas._testing
label_desc: Use image node_id 1 for calling a global function with example usage: test_add_prefix_suffix(string_series) without return types