<s> from python_toolbox import cute_testing <EOL> from python_toolbox . cute_iter_tools import get_single_if_any <EOL> def test_get_single_if_any ( ) : <EOL> assert get_single_if_any ( ( ) ) is get_single_if_any ( [ ] ) is get_single_if_any ( { } ) is get_single_if_any ( iter ( { } ) ) is get_single_if_any ( '<STR_LIT>' ) is None <EOL> assert get_single_if_any ( ( '<STR_LIT:g>' , ) ) == get_single_if_any ( [ '<STR_LIT:g>' ] ) == get_single_if_any ( { '<STR_LIT:g>' } ) == get_single_if_any ( iter ( { '<STR_LIT:g>' } ) ) == get_single_if_any ( '<STR_LIT:g>' ) == '<STR_LIT:g>' <EOL> with cute_testing . RaiseAssertor ( ) : <EOL> get_single_if_any ( ( '<STR_LIT:g>' , '<STR_LIT:e>' , '<STR_LIT:e>' ) ) <EOL> with cute_testing . RaiseAssertor ( ) : <EOL> get_single_if_any ( '<STR_LIT>' ) <EOL> assert get_single_if_any ( '<STR_LIT>' , exception_on_multiple = False ) == '<STR_LIT:g>' <EOL> assert get_single_if_any ( '<STR_LIT>' , none_on_multiple = True ) is None <EOL> assert get_single_if_any ( '<STR_LIT>' , none_on_multiple = True , <EOL> exception_on_multiple = False ) is None </s>
