#NEWLINE# @ pytest . mark . gen_test #NEWLINE# def test_graph_disable( session , graph , groups , http_client , base_url ) : #NEWLINE# #INDENT# ' Test that disabled groups work with the graph as expected.' #NEWLINE# groupname = 'serving-team' #NEWLINE# graph . update_from_db ( session ) #NEWLINE# old_groups = graph . groups #NEWLINE# assert ( sorted ( old_groups ) == sorted ( groups . keys ( ) ) ) #NEWLINE# assert ( groupname in graph . permission_metadata ) #NEWLINE# fe_url = url ( base_url , '/groups/{}/disable' . format ( graph ) ) #NEWLINE# resp = ( yield http_client . fetch ( fe_url , method = 'POST' , headers = { #NEWLINE# #INDENT# 'X-Grouper-User' : 'zorkian@a.co' , #NEWLINE# #UNINDENT# } , body = urlencode ( { #NEWLINE# #INDENT# 'name' : groupname , #NEWLINE# #UNINDENT# } ) ) ) #NEWLINE# assert ( resp . code == 200 ) #NEWLINE# graph . update_from_db ( session ) #NEWLINE# assert ( len ( graph . groups ) == ( len ( old_groups ) - 1 ) ) , 'disabled group removed from graph' #NEWLINE# assert ( groupname not in graph . groups ) #NEWLINE# assert ( groupname not in graph . permission_metadata )