<s> from webob . multidict import MultiDict <EOL> from pytest import raises <EOL> from pyramid . exceptions import Forbidden <EOL> from kotti . testing import DummyRequest <EOL> class TestAddableTypes : <EOL> def test_view_permitted_yes ( self , config , root ) : <EOL> from kotti . resources import Document <EOL> config . testing_securitypolicy ( permissive = True ) <EOL> config . include ( '<STR_LIT>' ) <EOL> request = DummyRequest ( ) <EOL> assert Document . type_info . addable ( root , request ) is True <EOL> def test_view_permitted_no ( self , config , root ) : <EOL> from kotti . resources import Document <EOL> config . testing_securitypolicy ( permissive = False ) <EOL> config . include ( '<STR_LIT>' ) <EOL> request = DummyRequest ( ) <EOL> assert Document . type_info . addable ( root , request ) is False <EOL> def test_addable_views_registered_to_some_context ( self , config , root ) : <EOL> from kotti . resources import Document , File <EOL> _saved = Document . type_info . addable_to <EOL> Document . type_info . addable_to = [ '<STR_LIT>' ] <EOL> config . testing_securitypolicy ( permissive = True ) <EOL> config . add_view ( <EOL> lambda context , request : { } , <EOL> name = Document . type_info . add_view , <EOL> permission = '<STR_LIT>' , <EOL> renderer = '<STR_LIT>' , <EOL> context = File , <EOL> ) <EOL> request = DummyRequest ( ) <EOL> assert Document . type_info . addable ( Document ( ) , request ) is False <EOL> assert Document . type_info . addable ( File ( ) , request ) is True <EOL> Document . type_info . addable_to = _saved <EOL> class TestNodePaste : <EOL> def test_get_non_existing_paste_item ( self , root ) : <EOL> from kotti . util import get_paste_items <EOL> request = DummyRequest ( ) <EOL> request . session [ '<STR_LIT>' ] = ( [ <NUM_LIT> ] , '<STR_LIT>' ) <EOL> item = get_paste_items ( root , request ) <EOL> assert item == [ ] <EOL> def test_paste_non_existing_node ( self , root ) : <EOL> from kotti . views . edit . actions import NodeActions <EOL> request = DummyRequest ( ) <EOL> for index , action in enumerate ( [ '<STR_LIT>' , '<STR_LIT>' ] ) : <EOL> request . session [ '<STR_LIT>' ] = ( [ <NUM_LIT> ] , '<STR_LIT>' ) <EOL> response = NodeActions ( root , request ) . paste_nodes ( ) <EOL> assert response . status == '<STR_LIT>' <EOL> assert len ( request . session [ '<STR_LIT>' ] ) == index + <NUM_LIT:1> <EOL> def test_paste_without_edit_permission ( self , config , root ) : <EOL> from kotti . views . edit . actions import NodeActions <EOL> request = DummyRequest ( ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> config . testing_securitypolicy ( permissive = False ) <EOL> request . session [ '<STR_LIT>' ] = ( [ <NUM_LIT:1> ] , '<STR_LIT>' ) <EOL> view = NodeActions ( root , request ) <EOL> with raises ( Forbidden ) : <EOL> view . paste_nodes ( ) <EOL> request . session [ '<STR_LIT>' ] = ( [ <NUM_LIT:1> ] , '<STR_LIT>' ) <EOL> response = NodeActions ( root , request ) . paste_nodes ( ) <EOL> assert response . status == '<STR_LIT>' <EOL> class TestNodeRename : <EOL> def setUp ( self ) : <EOL> from pyramid . threadlocal import get_current_registry <EOL> from kotti . url_normalizer import url_normalizer <EOL> r = get_current_registry ( ) <EOL> settings = r . settings = { } <EOL> settings [ '<STR_LIT>' ] = [ url_normalizer ] <EOL> settings [ '<STR_LIT>' ] = False <EOL> def test_rename_to_empty_name ( self , root ) : <EOL> from kotti . resources import Document <EOL> from kotti . views . edit . actions import NodeActions <EOL> child = root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> request = DummyRequest ( ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request . params [ '<STR_LIT:name>' ] = u'<STR_LIT>' <EOL> request . params [ '<STR_LIT:title>' ] = u'<STR_LIT:foo>' <EOL> NodeActions ( child , request ) . rename_node ( ) <EOL> assert ( request . session . pop_flash ( '<STR_LIT:error>' ) == <EOL> [ u'<STR_LIT>' ] ) <EOL> def test_multi_rename ( self , root ) : <EOL> from kotti . resources import Document <EOL> from kotti . views . edit . actions import NodeActions <EOL> self . setUp ( ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> request = DummyRequest ( ) <EOL> request . POST = MultiDict ( ) <EOL> id1 = str ( root [ '<STR_LIT>' ] . id ) <EOL> id2 = str ( root [ '<STR_LIT>' ] . id ) <EOL> request . POST . add ( '<STR_LIT>' , id1 ) <EOL> request . POST . add ( '<STR_LIT>' , id2 ) <EOL> request . POST . add ( id1 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( id1 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( id2 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( id2 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( '<STR_LIT>' , u'<STR_LIT>' ) <EOL> NodeActions ( root , request ) . rename_nodes ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:error>' ) == [ u'<STR_LIT>' ] <EOL> request . POST . add ( id1 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( id1 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( id2 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( id2 + '<STR_LIT>' , u'<STR_LIT>' ) <EOL> request . POST . add ( '<STR_LIT>' , u'<STR_LIT>' ) <EOL> NodeActions ( root , request ) . rename_nodes ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:success>' ) == [ u'<STR_LIT>' ] <EOL> class TestNodeDelete : <EOL> def test_multi_delete ( self , root ) : <EOL> from kotti . resources import Document <EOL> from kotti . resources import File <EOL> from kotti . views . edit . actions import NodeActions <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = File ( title = u"<STR_LIT>" ) <EOL> request = DummyRequest ( ) <EOL> request . POST = MultiDict ( ) <EOL> id1 = str ( root [ '<STR_LIT>' ] . id ) <EOL> id2 = str ( root [ '<STR_LIT>' ] . id ) <EOL> id3 = str ( root [ '<STR_LIT>' ] . id ) <EOL> request . POST . add ( '<STR_LIT>' , u'<STR_LIT>' ) <EOL> NodeActions ( root , request ) . delete_nodes ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:info>' ) == [ u'<STR_LIT>' ] <EOL> request . POST . add ( '<STR_LIT>' , id1 ) <EOL> request . POST . add ( '<STR_LIT>' , id2 ) <EOL> request . POST . add ( '<STR_LIT>' , id3 ) <EOL> NodeActions ( root , request ) . delete_nodes ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:success>' ) == [ u'<STR_LIT>' , <EOL> u'<STR_LIT>' , <EOL> u'<STR_LIT>' ] <EOL> class TestNodeMove : <EOL> def test_move_up ( self , root ) : <EOL> from kotti . resources import Document <EOL> from kotti . views . edit . actions import NodeActions <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> assert root [ '<STR_LIT>' ] . position < root [ '<STR_LIT>' ] . position <EOL> request = DummyRequest ( ) <EOL> request . session [ '<STR_LIT>' ] = [ str ( root [ '<STR_LIT>' ] . id ) ] <EOL> NodeActions ( root , request ) . up ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:success>' ) == [ u'<STR_LIT>' ] <EOL> assert root [ '<STR_LIT>' ] . position > root [ '<STR_LIT>' ] . position <EOL> def test_move_down ( self , root ) : <EOL> from kotti . resources import Document <EOL> from kotti . views . edit . actions import NodeActions <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> assert root [ '<STR_LIT>' ] . position < root [ '<STR_LIT>' ] . position <EOL> assert root [ '<STR_LIT>' ] . position < root [ '<STR_LIT>' ] . position <EOL> request = DummyRequest ( ) <EOL> ids = [ str ( root [ '<STR_LIT>' ] . id ) , str ( root [ '<STR_LIT>' ] . id ) ] <EOL> request . session [ '<STR_LIT>' ] = ids <EOL> NodeActions ( root , request ) . down ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:success>' ) == [ u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> assert root [ '<STR_LIT>' ] . position > root [ '<STR_LIT>' ] . position <EOL> assert root [ '<STR_LIT>' ] . position > root [ '<STR_LIT>' ] . position <EOL> def test_move_child_position_post ( self , root , db_session ) : <EOL> import transaction <EOL> from kotti . resources import Document <EOL> from kotti . resources import get_root <EOL> from kotti . views . edit . actions import move_child_position <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> assert [ c . position for c in root . _children ] == [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> assert [ c . name for c in root . _children ] == [ <EOL> u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> request = DummyRequest ( ) <EOL> request . POST = { '<STR_LIT>' : '<STR_LIT:0>' , '<STR_LIT:to>' : '<STR_LIT:3>' } <EOL> result = move_child_position ( root , request ) <EOL> transaction . commit ( ) <EOL> root = get_root ( ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:success>' <EOL> assert [ c . position for c in root . _children ] == [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> assert [ c . name for c in root . _children ] == [ <EOL> u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> request . POST = { '<STR_LIT>' : '<STR_LIT:4>' , '<STR_LIT:to>' : '<STR_LIT:0>' } <EOL> move_child_position ( root , request ) <EOL> transaction . commit ( ) <EOL> root = get_root ( ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:success>' <EOL> assert [ c . position for c in root . _children ] == [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> assert [ c . name for c in root . _children ] == [ <EOL> u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> request . POST = { '<STR_LIT>' : '<STR_LIT:a>' , '<STR_LIT:to>' : '<STR_LIT:3>' } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> request . POST = { '<STR_LIT>' : '<STR_LIT:0>' , '<STR_LIT:to>' : '<STR_LIT>' } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> request . POST = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:to>' : '<STR_LIT:0>' } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> request . POST = { '<STR_LIT>' : '<STR_LIT:a>' , } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> transaction . commit ( ) <EOL> def test_move_child_position_json ( self , root , db_session ) : <EOL> import transaction <EOL> from kotti . resources import Document <EOL> from kotti . resources import get_root <EOL> from kotti . views . edit . actions import move_child_position <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> assert [ c . position for c in root . _children ] == [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> assert [ c . name for c in root . _children ] == [ <EOL> u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> request = DummyRequest ( ) <EOL> request . json_body = { '<STR_LIT>' : '<STR_LIT:0>' , '<STR_LIT:to>' : '<STR_LIT:3>' } <EOL> result = move_child_position ( root , request ) <EOL> transaction . commit ( ) <EOL> root = get_root ( ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:success>' <EOL> assert [ c . position for c in root . _children ] == [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> assert [ c . name for c in root . _children ] == [ <EOL> u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> request . json_body = { '<STR_LIT>' : '<STR_LIT:4>' , '<STR_LIT:to>' : '<STR_LIT:0>' } <EOL> move_child_position ( root , request ) <EOL> transaction . commit ( ) <EOL> root = get_root ( ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:success>' <EOL> assert [ c . position for c in root . _children ] == [ <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ] <EOL> assert [ c . name for c in root . _children ] == [ <EOL> u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' , u'<STR_LIT>' ] <EOL> request . json_body = { '<STR_LIT>' : '<STR_LIT:a>' , '<STR_LIT:to>' : '<STR_LIT:3>' } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> request . json_body = { '<STR_LIT>' : '<STR_LIT:0>' , '<STR_LIT:to>' : '<STR_LIT>' } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> request . json_body = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT:to>' : '<STR_LIT:0>' } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> request . json_body = { '<STR_LIT>' : '<STR_LIT:a>' , } <EOL> result = move_child_position ( root , request ) <EOL> assert result [ '<STR_LIT:result>' ] == '<STR_LIT:error>' <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> del root [ '<STR_LIT>' ] <EOL> transaction . commit ( ) <EOL> class TestNodeShowHide : <EOL> def test_show_hide ( self , root ) : <EOL> from kotti . resources import Document <EOL> from kotti . views . edit . actions import NodeActions <EOL> root [ '<STR_LIT>' ] = Document ( title = u"<STR_LIT>" ) <EOL> assert root [ '<STR_LIT>' ] . in_navigation is True <EOL> request = DummyRequest ( ) <EOL> request . session [ '<STR_LIT>' ] = [ str ( root [ '<STR_LIT>' ] . id ) ] <EOL> NodeActions ( root , request ) . hide ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:success>' ) == [ u'<STR_LIT>' ] <EOL> assert root [ '<STR_LIT>' ] . in_navigation is False <EOL> request . session [ '<STR_LIT>' ] = [ str ( root [ '<STR_LIT>' ] . id ) ] <EOL> NodeActions ( root , request ) . show ( ) <EOL> assert request . session . pop_flash ( '<STR_LIT:success>' ) == [ u'<STR_LIT>' ] <EOL> assert root [ '<STR_LIT>' ] . in_navigation is True <EOL> class TestNodeShare : <EOL> def test_roles ( self , root ) : <EOL> from kotti . views . users import share_node <EOL> from kotti . security import SHARING_ROLES <EOL> request = DummyRequest ( ) <EOL> assert ( <EOL> [ r . name for r in share_node ( root , request ) [ '<STR_LIT>' ] ] == <EOL> SHARING_ROLES ) <EOL> def test_search ( self , extra_principals , root ) : <EOL> from kotti . security import get_principals <EOL> from kotti . security import set_groups <EOL> from kotti . views . users import share_node <EOL> request = DummyRequest ( ) <EOL> P = get_principals ( ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> entries = share_node ( root , request ) [ '<STR_LIT>' ] <EOL> assert len ( entries ) == <NUM_LIT:2> <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] == P [ '<STR_LIT>' ] <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] == ( [ ] , [ ] ) <EOL> assert entries [ <NUM_LIT:1> ] [ <NUM_LIT:0> ] == P [ '<STR_LIT>' ] <EOL> assert entries [ <NUM_LIT:1> ] [ <NUM_LIT:1> ] == ( [ ] , [ ] ) <EOL> set_groups ( u'<STR_LIT>' , root , [ u'<STR_LIT>' ] ) <EOL> P [ u'<STR_LIT>' ] . groups = [ u'<STR_LIT>' ] <EOL> entries = share_node ( root , request ) [ '<STR_LIT>' ] <EOL> assert len ( entries ) == <NUM_LIT:2> <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] == P [ '<STR_LIT>' ] <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] == ( [ u'<STR_LIT>' ] , [ ] ) <EOL> assert entries [ <NUM_LIT:1> ] [ <NUM_LIT:0> ] == P [ '<STR_LIT>' ] <EOL> assert entries [ <NUM_LIT:1> ] [ <NUM_LIT:1> ] == ( [ u'<STR_LIT>' ] , [ u'<STR_LIT>' ] ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> entries = share_node ( root , request ) [ '<STR_LIT>' ] <EOL> assert len ( entries ) == <NUM_LIT:1> <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] == P [ u'<STR_LIT>' ] <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] == ( [ u'<STR_LIT>' ] , [ ] ) <EOL> assert ( request . session . pop_flash ( '<STR_LIT:info>' ) == <EOL> [ u'<STR_LIT>' ] ) <EOL> set_groups ( u'<STR_LIT>' , root , [ u'<STR_LIT>' ] ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> entries = share_node ( root , request ) [ '<STR_LIT>' ] <EOL> assert len ( entries ) == <NUM_LIT:1> <EOL> assert entries [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] == P [ '<STR_LIT>' ] <EOL> def test_apply ( self , extra_principals , root ) : <EOL> from kotti . security import list_groups <EOL> from kotti . security import set_groups <EOL> from kotti . views . users import share_node <EOL> request = DummyRequest ( ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> share_node ( root , request ) <EOL> assert ( request . session . pop_flash ( '<STR_LIT:info>' ) == [ u'<STR_LIT>' ] ) <EOL> assert list_groups ( '<STR_LIT>' , root ) == [ ] <EOL> set_groups ( '<STR_LIT>' , root , [ '<STR_LIT>' ] ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT:1>' <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT:1>' <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> share_node ( root , request ) <EOL> assert ( request . session . pop_flash ( '<STR_LIT:success>' ) == <EOL> [ u'<STR_LIT>' ] ) <EOL> assert ( <EOL> set ( list_groups ( '<STR_LIT>' , root ) ) == <EOL> { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' } <EOL> ) <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT:1>' <EOL> request . params [ '<STR_LIT>' ] = u'<STR_LIT>' <EOL> with raises ( Forbidden ) : <EOL> share_node ( root , request ) <EOL> assert ( <EOL> set ( list_groups ( '<STR_LIT>' , root ) ) == <EOL> { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' } <EOL> ) </s>
