@@ -133,40 +133,40 @@ def test_from_api_repr_with_mismatched_project(self):
133133 RESOURCE , client = CLIENT )
134134
135135 def test_create_w_bound_client (self ):
136- FULL = 'projects/%s/metrics/%s ' % (self .PROJECT , self . METRIC_NAME )
136+ TARGET = 'projects/%s/metrics' % (self .PROJECT ,)
137137 RESOURCE = {
138138 'name' : self .METRIC_NAME ,
139139 'filter' : self .FILTER ,
140140 }
141- conn = _Connection ({ 'name' : FULL } )
141+ conn = _Connection (RESOURCE )
142142 client = _Client (project = self .PROJECT , connection = conn )
143143 metric = self ._makeOne (self .METRIC_NAME , self .FILTER , client = client )
144144 metric .create ()
145145 self .assertEqual (len (conn ._requested ), 1 )
146146 req = conn ._requested [0 ]
147- self .assertEqual (req ['method' ], 'PUT ' )
148- self .assertEqual (req ['path' ], '/%s' % FULL )
147+ self .assertEqual (req ['method' ], 'POST ' )
148+ self .assertEqual (req ['path' ], '/%s' % TARGET )
149149 self .assertEqual (req ['data' ], RESOURCE )
150150
151151 def test_create_w_alternate_client (self ):
152- FULL = 'projects/%s/metrics/%s ' % (self .PROJECT , self . METRIC_NAME )
152+ TARGET = 'projects/%s/metrics' % (self .PROJECT ,)
153153 RESOURCE = {
154154 'name' : self .METRIC_NAME ,
155155 'filter' : self .FILTER ,
156156 'description' : self .DESCRIPTION ,
157157 }
158- conn1 = _Connection ({ 'name' : FULL } )
158+ conn1 = _Connection ()
159159 client1 = _Client (project = self .PROJECT , connection = conn1 )
160- conn2 = _Connection ({ 'name' : FULL } )
160+ conn2 = _Connection (RESOURCE )
161161 client2 = _Client (project = self .PROJECT , connection = conn2 )
162162 metric = self ._makeOne (self .METRIC_NAME , self .FILTER , client = client1 ,
163163 description = self .DESCRIPTION )
164164 metric .create (client = client2 )
165165 self .assertEqual (len (conn1 ._requested ), 0 )
166166 self .assertEqual (len (conn2 ._requested ), 1 )
167167 req = conn2 ._requested [0 ]
168- self .assertEqual (req ['method' ], 'PUT ' )
169- self .assertEqual (req ['path' ], '/%s' % FULL )
168+ self .assertEqual (req ['method' ], 'POST ' )
169+ self .assertEqual (req ['path' ], '/%s' % TARGET )
170170 self .assertEqual (req ['data' ], RESOURCE )
171171
172172 def test_exists_miss_w_bound_client (self ):
0 commit comments