#NEWLINE# def test_get_container_id( ) : #NEWLINE# #INDENT# mock_docker_client = mock . MagicMock ( spec_set = docker . Client ) #NEWLINE# fake_containers = [ { #NEWLINE# #INDENT# 'Names' : [ '/paasta_local_run_1' ] , #NEWLINE# 'Id' : '11111' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# 'Names' : [ '/paasta_local_run_2' ] , #NEWLINE# 'Id' : '22222' , #NEWLINE# #UNINDENT# } ] #NEWLINE# mock_docker_client . containers = mock . MagicMock ( spec_set = docker . Client , return_value = fake_containers ) #NEWLINE# container_name = 'paasta_local_run_2' #NEWLINE# expected = '22222' #NEWLINE# actual = get_container_id ( mock_docker_client , container_name ) #NEWLINE# assert ( actual == expected )