<s> """<STR_LIT>""" <EOL> import copy <EOL> import mock <EOL> import six . moves . urllib . parse as urlparse <EOL> import webob <EOL> from nova . api . openstack . compute import images as images_v21 <EOL> from nova . api . openstack . compute . legacy_v2 import images <EOL> from nova . api . openstack . compute . views import images as images_view <EOL> from nova import exception <EOL> from nova . image import glance <EOL> from nova import test <EOL> from nova . tests . unit . api . openstack import fakes <EOL> from nova . tests . unit import image_fixtures <EOL> from nova . tests . unit import matchers <EOL> NS = "<STR_LIT>" <EOL> ATOMNS = "<STR_LIT>" <EOL> NOW_API_FORMAT = "<STR_LIT>" <EOL> IMAGE_FIXTURES = image_fixtures . get_image_fixtures ( ) <EOL> class ImagesControllerTestV21 ( test . NoDBTestCase ) : <EOL> """<STR_LIT>""" <EOL> image_controller_class = images_v21 . ImagesController <EOL> url_base = '<STR_LIT>' <EOL> bookmark_base = '<STR_LIT>' <EOL> http_request = fakes . HTTPRequestV21 <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> super ( ImagesControllerTestV21 , self ) . setUp ( ) <EOL> self . flags ( api_servers = [ '<STR_LIT>' ] , group = '<STR_LIT>' ) <EOL> fakes . stub_out_networking ( self ) <EOL> fakes . stub_out_rate_limiting ( self . stubs ) <EOL> fakes . stub_out_key_pair_funcs ( self . stubs ) <EOL> fakes . stub_out_compute_api_snapshot ( self . stubs ) <EOL> fakes . stub_out_compute_api_backup ( self . stubs ) <EOL> self . controller = self . image_controller_class ( ) <EOL> self . url_prefix = "<STR_LIT>" % self . url_base <EOL> self . bookmark_prefix = "<STR_LIT>" % self . bookmark_base <EOL> self . uuid = '<STR_LIT>' <EOL> self . server_uuid = "<STR_LIT>" <EOL> self . server_href = ( <EOL> "<STR_LIT>" % ( self . url_base , <EOL> self . server_uuid ) ) <EOL> self . server_bookmark = ( <EOL> "<STR_LIT>" % ( self . bookmark_base , <EOL> self . server_uuid ) ) <EOL> self . alternate = "<STR_LIT>" <EOL> self . expected_image_123 = { <EOL> "<STR_LIT:image>" : { '<STR_LIT:id>' : '<STR_LIT>' , <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { '<STR_LIT>' : '<STR_LIT>' } , <EOL> '<STR_LIT>' : NOW_API_FORMAT , <EOL> '<STR_LIT>' : NOW_API_FORMAT , <EOL> '<STR_LIT:status>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:10> , <EOL> '<STR_LIT>' : <NUM_LIT:100> , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> "<STR_LIT>" : [ { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" % self . url_prefix <EOL> } , <EOL> { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : <EOL> "<STR_LIT>" % self . bookmark_prefix <EOL> } , <EOL> { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:type>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : self . alternate % <EOL> ( glance . generate_glance_url ( ) , <EOL> <NUM_LIT> ) , <EOL> } ] , <EOL> } , <EOL> } <EOL> self . expected_image_124 = { <EOL> "<STR_LIT:image>" : { '<STR_LIT:id>' : '<STR_LIT>' , <EOL> '<STR_LIT:name>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : { <EOL> u'<STR_LIT>' : self . server_uuid , <EOL> u'<STR_LIT>' : u'<STR_LIT>' , <EOL> } , <EOL> '<STR_LIT>' : NOW_API_FORMAT , <EOL> '<STR_LIT>' : NOW_API_FORMAT , <EOL> '<STR_LIT:status>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT>' : <NUM_LIT:0> , <EOL> '<STR_LIT>' : <NUM_LIT:0> , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT:id>' : self . server_uuid , <EOL> "<STR_LIT>" : [ { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : self . server_href , <EOL> } , <EOL> { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : self . server_bookmark , <EOL> } ] , <EOL> } , <EOL> "<STR_LIT>" : [ { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" % self . url_prefix <EOL> } , <EOL> { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : <EOL> "<STR_LIT>" % self . bookmark_prefix <EOL> } , <EOL> { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT:type>" : <EOL> "<STR_LIT>" , <EOL> "<STR_LIT>" : self . alternate % <EOL> ( glance . generate_glance_url ( ) , <EOL> <NUM_LIT> ) , <EOL> } ] , <EOL> } , <EOL> } <EOL> @ mock . patch ( '<STR_LIT>' , return_value = IMAGE_FIXTURES [ <NUM_LIT:0> ] ) <EOL> def test_get_image ( self , get_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> actual_image = self . controller . show ( request , '<STR_LIT>' ) <EOL> self . assertThat ( actual_image , <EOL> matchers . DictMatches ( self . expected_image_123 ) ) <EOL> get_mocked . assert_called_once_with ( mock . ANY , '<STR_LIT>' ) <EOL> @ mock . patch ( '<STR_LIT>' , return_value = IMAGE_FIXTURES [ <NUM_LIT:1> ] ) <EOL> def test_get_image_with_custom_prefix ( self , _get_mocked ) : <EOL> self . flags ( osapi_compute_link_prefix = '<STR_LIT>' , <EOL> osapi_glance_link_prefix = '<STR_LIT>' ) <EOL> fake_req = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> actual_image = self . controller . show ( fake_req , '<STR_LIT>' ) <EOL> expected_image = self . expected_image_124 <EOL> expected_image [ "<STR_LIT:image>" ] [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % self . url_base ) <EOL> expected_image [ "<STR_LIT:image>" ] [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % self . bookmark_base ) <EOL> expected_image [ "<STR_LIT:image>" ] [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" ) <EOL> expected_image [ "<STR_LIT:image>" ] [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % ( self . url_base , <EOL> self . server_uuid ) ) <EOL> expected_image [ "<STR_LIT:image>" ] [ "<STR_LIT>" ] [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % ( self . bookmark_base , <EOL> self . server_uuid ) ) <EOL> self . assertThat ( actual_image , matchers . DictMatches ( expected_image ) ) <EOL> @ mock . patch ( '<STR_LIT>' , <EOL> side_effect = exception . ImageNotFound ( image_id = '<STR_LIT>' ) ) <EOL> def test_get_image_404 ( self , _get_mocked ) : <EOL> fake_req = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> self . assertRaises ( webob . exc . HTTPNotFound , <EOL> self . controller . show , fake_req , '<STR_LIT>' ) <EOL> @ mock . patch ( '<STR_LIT>' , return_value = IMAGE_FIXTURES ) <EOL> def test_get_image_details ( self , get_all_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> response = self . controller . detail ( request ) <EOL> get_all_mocked . assert_called_once_with ( mock . ANY , filters = { } ) <EOL> response_list = response [ "<STR_LIT>" ] <EOL> image_125 = copy . deepcopy ( self . expected_image_124 [ "<STR_LIT:image>" ] ) <EOL> image_125 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_125 [ '<STR_LIT:name>' ] = '<STR_LIT>' <EOL> image_125 [ '<STR_LIT>' ] = <NUM_LIT:50> <EOL> image_125 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_125 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_125 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> image_126 = copy . deepcopy ( self . expected_image_124 [ "<STR_LIT:image>" ] ) <EOL> image_126 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_126 [ '<STR_LIT:name>' ] = '<STR_LIT>' <EOL> image_126 [ '<STR_LIT:status>' ] = '<STR_LIT>' <EOL> image_126 [ '<STR_LIT>' ] = <NUM_LIT:100> <EOL> image_126 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_126 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_126 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> image_127 = copy . deepcopy ( self . expected_image_124 [ "<STR_LIT:image>" ] ) <EOL> image_127 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_127 [ '<STR_LIT:name>' ] = '<STR_LIT>' <EOL> image_127 [ '<STR_LIT:status>' ] = '<STR_LIT>' <EOL> image_127 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_127 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_127 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_127 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> image_128 = copy . deepcopy ( self . expected_image_124 [ "<STR_LIT:image>" ] ) <EOL> image_128 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_128 [ '<STR_LIT:name>' ] = '<STR_LIT>' <EOL> image_128 [ '<STR_LIT:status>' ] = '<STR_LIT>' <EOL> image_128 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_128 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_128 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_128 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> image_129 = copy . deepcopy ( self . expected_image_124 [ "<STR_LIT:image>" ] ) <EOL> image_129 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_129 [ '<STR_LIT:name>' ] = '<STR_LIT>' <EOL> image_129 [ '<STR_LIT:status>' ] = '<STR_LIT>' <EOL> image_129 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_129 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_129 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_129 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> image_130 = copy . deepcopy ( self . expected_image_123 [ "<STR_LIT:image>" ] ) <EOL> image_130 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_130 [ '<STR_LIT:name>' ] = None <EOL> image_130 [ '<STR_LIT>' ] = { } <EOL> image_130 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_130 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_130 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_130 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_130 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> image_131 = copy . deepcopy ( self . expected_image_123 [ "<STR_LIT:image>" ] ) <EOL> image_131 [ '<STR_LIT:id>' ] = '<STR_LIT>' <EOL> image_131 [ '<STR_LIT:name>' ] = None <EOL> image_131 [ '<STR_LIT>' ] = { } <EOL> image_131 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_131 [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> image_131 [ "<STR_LIT>" ] [ <NUM_LIT:0> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . url_prefix <EOL> image_131 [ "<STR_LIT>" ] [ <NUM_LIT:1> ] [ "<STR_LIT>" ] = "<STR_LIT>" % self . bookmark_prefix <EOL> image_131 [ "<STR_LIT>" ] [ <NUM_LIT:2> ] [ "<STR_LIT>" ] = ( <EOL> "<STR_LIT>" % glance . generate_glance_url ( ) ) <EOL> expected = [ self . expected_image_123 [ "<STR_LIT:image>" ] , <EOL> self . expected_image_124 [ "<STR_LIT:image>" ] , <EOL> image_125 , image_126 , image_127 , <EOL> image_128 , image_129 , image_130 , <EOL> image_131 ] <EOL> self . assertThat ( expected , matchers . DictListMatches ( response_list ) ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def test_get_image_details_with_limit ( self , get_all_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + <EOL> '<STR_LIT>' ) <EOL> self . controller . detail ( request ) <EOL> get_all_mocked . assert_called_once_with ( mock . ANY , limit = <NUM_LIT:2> , filters = { } ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def test_get_image_details_with_limit_and_page_size ( self , get_all_mocked ) : <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' ) <EOL> self . controller . detail ( request ) <EOL> get_all_mocked . assert_called_once_with ( mock . ANY , limit = <NUM_LIT:2> , filters = { } , <EOL> page_size = <NUM_LIT:1> ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def _detail_request ( self , filters , request , get_all_mocked ) : <EOL> self . controller . detail ( request ) <EOL> get_all_mocked . assert_called_once_with ( mock . ANY , filters = filters ) <EOL> def test_image_detail_filter_with_name ( self ) : <EOL> filters = { '<STR_LIT:name>' : '<STR_LIT>' } <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_with_status ( self ) : <EOL> filters = { '<STR_LIT:status>' : '<STR_LIT>' } <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_with_property ( self ) : <EOL> filters = { '<STR_LIT>' : '<STR_LIT:3>' } <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_server_href ( self ) : <EOL> filters = { '<STR_LIT>' : self . uuid } <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' + self . uuid ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_server_uuid ( self ) : <EOL> filters = { '<STR_LIT>' : self . uuid } <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' + self . uuid ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_changes_since ( self ) : <EOL> filters = { '<STR_LIT>' : '<STR_LIT>' } <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_with_type ( self ) : <EOL> filters = { '<STR_LIT>' : '<STR_LIT>' } <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_filter_not_supported ( self ) : <EOL> filters = { '<STR_LIT:status>' : '<STR_LIT>' } <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> def test_image_detail_no_filters ( self ) : <EOL> filters = { } <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> self . _detail_request ( filters , request ) <EOL> @ mock . patch ( '<STR_LIT>' , side_effect = exception . Invalid ) <EOL> def test_image_detail_invalid_marker ( self , _get_all_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> self . assertRaises ( webob . exc . HTTPBadRequest , self . controller . detail , <EOL> request ) <EOL> def test_generate_alternate_link ( self ) : <EOL> view = images_view . ViewBuilder ( ) <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> generated_url = view . _get_alternate_link ( request , <NUM_LIT:1> ) <EOL> actual_url = "<STR_LIT>" % glance . generate_glance_url ( ) <EOL> self . assertEqual ( generated_url , actual_url ) <EOL> def _check_response ( self , controller_method , response , expected_code ) : <EOL> self . assertEqual ( expected_code , controller_method . wsgi_code ) <EOL> @ mock . patch ( '<STR_LIT>' ) <EOL> def test_delete_image ( self , delete_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> request . method = '<STR_LIT>' <EOL> response = self . controller . delete ( request , '<STR_LIT>' ) <EOL> self . _check_response ( self . controller . delete , response , <NUM_LIT> ) <EOL> delete_mocked . assert_called_once_with ( mock . ANY , '<STR_LIT>' ) <EOL> @ mock . patch ( '<STR_LIT>' , <EOL> side_effect = exception . ImageNotAuthorized ( image_id = '<STR_LIT>' ) ) <EOL> def test_delete_deleted_image ( self , _delete_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> request . method = '<STR_LIT>' <EOL> self . assertRaises ( webob . exc . HTTPForbidden , self . controller . delete , <EOL> request , '<STR_LIT>' ) <EOL> @ mock . patch ( '<STR_LIT>' , <EOL> side_effect = exception . ImageNotFound ( image_id = '<STR_LIT>' ) ) <EOL> def test_delete_image_not_found ( self , _delete_mocked ) : <EOL> request = self . http_request . blank ( self . url_base + '<STR_LIT>' ) <EOL> request . method = '<STR_LIT>' <EOL> self . assertRaises ( webob . exc . HTTPNotFound , <EOL> self . controller . delete , request , '<STR_LIT>' ) <EOL> @ mock . patch ( '<STR_LIT>' , return_value = [ IMAGE_FIXTURES [ <NUM_LIT:0> ] ] ) <EOL> def test_get_image_next_link ( self , get_all_mocked ) : <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' ) <EOL> response = self . controller . index ( request ) <EOL> response_links = response [ '<STR_LIT>' ] <EOL> href_parts = urlparse . urlparse ( response_links [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . url_base + '<STR_LIT>' , href_parts . path ) <EOL> params = urlparse . parse_qs ( href_parts . query ) <EOL> self . assertThat ( { '<STR_LIT>' : [ '<STR_LIT:1>' ] , '<STR_LIT>' : [ IMAGE_FIXTURES [ <NUM_LIT:0> ] [ '<STR_LIT:id>' ] ] } , <EOL> matchers . DictMatches ( params ) ) <EOL> @ mock . patch ( '<STR_LIT>' , return_value = [ IMAGE_FIXTURES [ <NUM_LIT:0> ] ] ) <EOL> def test_get_image_details_next_link ( self , get_all_mocked ) : <EOL> request = self . http_request . blank ( <EOL> self . url_base + '<STR_LIT>' ) <EOL> response = self . controller . detail ( request ) <EOL> response_links = response [ '<STR_LIT>' ] <EOL> href_parts = urlparse . urlparse ( response_links [ <NUM_LIT:0> ] [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( self . url_base + '<STR_LIT>' , href_parts . path ) <EOL> params = urlparse . parse_qs ( href_parts . query ) <EOL> self . assertThat ( { '<STR_LIT>' : [ '<STR_LIT:1>' ] , '<STR_LIT>' : [ IMAGE_FIXTURES [ <NUM_LIT:0> ] [ '<STR_LIT:id>' ] ] } , <EOL> matchers . DictMatches ( params ) ) <EOL> class ImagesControllerTestV2 ( ImagesControllerTestV21 ) : <EOL> image_controller_class = images . Controller <EOL> http_request = fakes . HTTPRequest <EOL> def _check_response ( self , controller_method , response , expected_code ) : <EOL> self . assertEqual ( expected_code , response . status_int ) </s>
