code: def test_swap_curly():
      """Test swap curly function"""
      for str in (
          "foo",
          "foo foo foo bar",
          "foo béè b¡ð/ĳə˘©þß®~¯æ",
          "foo béè b¡ð/ĳə˘©þß®~¯æ",
      ):
          assert _swap_curly(str) == str
      assert _swap_curly("foo{bar}baz") == "foo{{bar}}baz"
      assert _swap_curly("foo{{bar}}baz") == "foo{bar}baz"
      assert _swap_curly("{foo}{{bar}}{baz}") == "{{foo}}{bar}{{baz}}"
      assert (
          _swap_curly("{foo}{{{bar}}}{baz}")
          == "{{foo}}{{{bar}}}{{baz}}"
      )
      assert _swap_curly("foo{ bar }baz") == "foo{{ bar }}baz"
      assert _swap_curly("foo{ bar}baz") == "foo{{ bar}}baz"
      assert _swap_curly("foo{bar }baz") == "foo{{bar }}baz"
      assert _swap_curly("foo{{ bar }}baz") == "foo{bar}baz"
      assert _swap_curly("foo{{bar }}baz") == "foo{bar}baz"
      assert _swap_curly("foo{{ bar}}baz") == "foo{bar}baz"
  
file_path: pygal/pygal/test/test_util.py
imports: from pytest import raises
  from pygal.util import _swap_curly, majorize, mergextend, minify_css, round_to_float, round_to_int, template, truncate
label_desc: Use image node_id 3 for calling a global function with example usage: test_swap_curly() without return types