<s> import pytest <EOL> pytest . importorskip ( "<STR_LIT>" ) <EOL> from aiopg . sa . connection import _distill_params <EOL> def test_distill_none ( ) : <EOL> assert _distill_params ( None , None ) == [ ] <EOL> def test_distill_no_multi_no_param ( ) : <EOL> assert _distill_params ( ( ) , { } ) == [ ] <EOL> def test_distill_dict_multi_none_param ( ) : <EOL> assert _distill_params ( None , { "<STR_LIT:foo>" : "<STR_LIT:bar>" } ) == [ { "<STR_LIT:foo>" : "<STR_LIT:bar>" } ] <EOL> def test_distill_dict_multi_empty_param ( ) : <EOL> assert _distill_params ( ( ) , { "<STR_LIT:foo>" : "<STR_LIT:bar>" } ) == [ { "<STR_LIT:foo>" : "<STR_LIT:bar>" } ] <EOL> def test_distill_single_dict ( ) : <EOL> assert _distill_params ( ( { "<STR_LIT:foo>" : "<STR_LIT:bar>" } , ) , { } ) == [ { "<STR_LIT:foo>" : "<STR_LIT:bar>" } ] <EOL> def test_distill_single_list_strings ( ) : <EOL> assert _distill_params ( ( [ "<STR_LIT:foo>" , "<STR_LIT:bar>" ] , ) , { } ) == [ [ "<STR_LIT:foo>" , "<STR_LIT:bar>" ] ] <EOL> def test_distill_single_list_tuples ( ) : <EOL> v1 = _distill_params ( ( [ ( "<STR_LIT:foo>" , "<STR_LIT:bar>" ) , ( "<STR_LIT>" , "<STR_LIT>" ) ] , ) , { } ) <EOL> v2 = [ ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) , ( '<STR_LIT>' , '<STR_LIT>' ) ] <EOL> assert v1 == v2 <EOL> def test_distill_single_list_tuple ( ) : <EOL> v1 = _distill_params ( ( [ ( "<STR_LIT:foo>" , "<STR_LIT:bar>" ) ] , ) , { } ) <EOL> v2 = [ ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) ] <EOL> assert v1 == v2 <EOL> def test_distill_multi_list_tuple ( ) : <EOL> v1 = _distill_params ( <EOL> ( [ ( "<STR_LIT:foo>" , "<STR_LIT:bar>" ) ] , [ ( "<STR_LIT:bar>" , "<STR_LIT>" ) ] ) , <EOL> { } ) <EOL> v2 = ( [ ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) ] , [ ( '<STR_LIT:bar>' , '<STR_LIT>' ) ] ) <EOL> assert v1 == v2 <EOL> def test_distill_multi_strings ( ) : <EOL> assert _distill_params ( ( "<STR_LIT:foo>" , "<STR_LIT:bar>" ) , { } ) == [ ( '<STR_LIT:foo>' , '<STR_LIT:bar>' ) ] <EOL> def test_distill_single_list_dicts ( ) : <EOL> v1 = _distill_params ( ( [ { "<STR_LIT:foo>" : "<STR_LIT:bar>" } , { "<STR_LIT:foo>" : "<STR_LIT>" } ] , ) , { } ) <EOL> assert v1 == [ { '<STR_LIT:foo>' : '<STR_LIT:bar>' } , { '<STR_LIT:foo>' : '<STR_LIT>' } ] <EOL> def test_distill_single_string ( ) : <EOL> assert _distill_params ( ( "<STR_LIT>" , ) , { } ) == [ [ "<STR_LIT>" ] ] <EOL> def test_distill_multi_string_tuple ( ) : <EOL> v1 = _distill_params ( ( ( "<STR_LIT>" , "<STR_LIT>" ) , ) , { } ) <EOL> assert v1 == [ ( "<STR_LIT>" , "<STR_LIT>" ) ] </s>
