def test_swap_curly():
 for str in ('foo', u('foo foo foo bar'), 'foo b\xc3\xa9\xc3\xa8 b\xc2\xa1\xc3\xb0/\xc4\xb3\xc9\x99\xcb\x98\xc2\xa9\xc3\xbe\xc3\x9f\xc2\xae~\xc2\xaf\xc3\xa6', u('foo b\xc3\xa9\xc3\xa8 b\xc2\xa1\xc3\xb0/\xc4\xb3\xc9\x99\xcb\x98\xc2\xa9\xc3\xbe\xc3\x9f\xc2\xae~\xc2\xaf\xc3\xa6')):
  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')

def test_swap_curly ( ) : for str in ( 'foo' , u ( 'foo foo foo bar' ) , 'foo b\xc3\xa9\xc3\xa8 b\xc2\xa1\xc3\xb0/\xc4\xb3\xc9\x99\xcb\x98\xc2\xa9\xc3\xbe\xc3\x9f\xc2\xae~\xc2\xaf\xc3\xa6' , u ( 'foo b\xc3\xa9\xc3\xa8 b\xc2\xa1\xc3\xb0/\xc4\xb3\xc9\x99\xcb\x98\xc2\xa9\xc3\xbe\xc3\x9f\xc2\xae~\xc2\xaf\xc3\xa6' ) ) : 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' )
test swap curly function .