#NEWLINE# def test_sort_service_dicts_7( self ) : #NEWLINE# #INDENT# services = [ { #NEWLINE# #INDENT# 'network_mode' : 'service:three' , #NEWLINE# 'name' : 'four' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'links' : [ 'two' ] , #NEWLINE# 'name' : 'three' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'two' , #NEWLINE# 'volumes_from' : [ VolumeFromSpec ( 'one' , 'rw' , 'service' ) ] , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'name' : 'one' , #NEWLINE# #UNINDENT# } ] #NEWLINE# sorted_services = sort_service_dicts ( services ) #NEWLINE# assert ( len ( sorted_services ) == 4 ) #NEWLINE# assert ( sorted_services [ 0 ] [ 'name' ] == 'one' ) #NEWLINE# assert ( sorted_services [ 1 ] [ 'name' ] == 'two' ) #NEWLINE# assert ( sorted_services [ 2 ] [ 'name' ] == 'three' ) #NEWLINE# assert ( sorted_services [ 3 ] [ 'name' ] == 'four' )