| OLD | NEW |
| 1 library googleapis.pubsub.v1.test; | 1 library googleapis.pubsub.v1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:test/test.dart' as unittest; |
| 11 | 11 |
| 12 import 'package:googleapis/pubsub/v1.dart' as api; | 12 import 'package:googleapis/pubsub/v1.dart' as api; |
| 13 | 13 |
| 14 class HttpServerMock extends http.BaseClient { | 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 15 core.Function _callback; |
| 16 core.bool _expectJson; | 16 core.bool _expectJson; |
| 17 | 17 |
| 18 void register(core.Function callback, core.bool expectJson) { | 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 19 _callback = callback; |
| 20 _expectJson = expectJson; | 20 _expectJson = expectJson; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 } else { | 39 } else { |
| 40 return stream.toBytes().then((data) { | 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 41 return _callback(request, data); |
| 42 }); | 42 }); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 buildUnnamed1187() { | 54 buildUnnamed1194() { |
| 55 var o = new core.List<core.String>(); | 55 var o = new core.List<core.String>(); |
| 56 o.add("foo"); | 56 o.add("foo"); |
| 57 o.add("foo"); | 57 o.add("foo"); |
| 58 return o; | 58 return o; |
| 59 } | 59 } |
| 60 | 60 |
| 61 checkUnnamed1187(core.List<core.String> o) { | 61 checkUnnamed1194(core.List<core.String> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); | 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 unittest.expect(o[0], unittest.equals('foo')); | 63 unittest.expect(o[0], unittest.equals('foo')); |
| 64 unittest.expect(o[1], unittest.equals('foo')); | 64 unittest.expect(o[1], unittest.equals('foo')); |
| 65 } | 65 } |
| 66 | 66 |
| 67 core.int buildCounterAcknowledgeRequest = 0; | 67 core.int buildCounterAcknowledgeRequest = 0; |
| 68 buildAcknowledgeRequest() { | 68 buildAcknowledgeRequest() { |
| 69 var o = new api.AcknowledgeRequest(); | 69 var o = new api.AcknowledgeRequest(); |
| 70 buildCounterAcknowledgeRequest++; | 70 buildCounterAcknowledgeRequest++; |
| 71 if (buildCounterAcknowledgeRequest < 3) { | 71 if (buildCounterAcknowledgeRequest < 3) { |
| 72 o.ackIds = buildUnnamed1187(); | 72 o.ackIds = buildUnnamed1194(); |
| 73 } | 73 } |
| 74 buildCounterAcknowledgeRequest--; | 74 buildCounterAcknowledgeRequest--; |
| 75 return o; | 75 return o; |
| 76 } | 76 } |
| 77 | 77 |
| 78 checkAcknowledgeRequest(api.AcknowledgeRequest o) { | 78 checkAcknowledgeRequest(api.AcknowledgeRequest o) { |
| 79 buildCounterAcknowledgeRequest++; | 79 buildCounterAcknowledgeRequest++; |
| 80 if (buildCounterAcknowledgeRequest < 3) { | 80 if (buildCounterAcknowledgeRequest < 3) { |
| 81 checkUnnamed1187(o.ackIds); | 81 checkUnnamed1194(o.ackIds); |
| 82 } | 82 } |
| 83 buildCounterAcknowledgeRequest--; | 83 buildCounterAcknowledgeRequest--; |
| 84 } | 84 } |
| 85 | 85 |
| 86 buildUnnamed1188() { | 86 buildUnnamed1195() { |
| 87 var o = new core.List<core.String>(); | 87 var o = new core.List<core.String>(); |
| 88 o.add("foo"); | 88 o.add("foo"); |
| 89 o.add("foo"); | 89 o.add("foo"); |
| 90 return o; | 90 return o; |
| 91 } | 91 } |
| 92 | 92 |
| 93 checkUnnamed1188(core.List<core.String> o) { | 93 checkUnnamed1195(core.List<core.String> o) { |
| 94 unittest.expect(o, unittest.hasLength(2)); | 94 unittest.expect(o, unittest.hasLength(2)); |
| 95 unittest.expect(o[0], unittest.equals('foo')); | 95 unittest.expect(o[0], unittest.equals('foo')); |
| 96 unittest.expect(o[1], unittest.equals('foo')); | 96 unittest.expect(o[1], unittest.equals('foo')); |
| 97 } | 97 } |
| 98 | 98 |
| 99 core.int buildCounterBinding = 0; | 99 core.int buildCounterBinding = 0; |
| 100 buildBinding() { | 100 buildBinding() { |
| 101 var o = new api.Binding(); | 101 var o = new api.Binding(); |
| 102 buildCounterBinding++; | 102 buildCounterBinding++; |
| 103 if (buildCounterBinding < 3) { | 103 if (buildCounterBinding < 3) { |
| 104 o.members = buildUnnamed1188(); | 104 o.members = buildUnnamed1195(); |
| 105 o.role = "foo"; | 105 o.role = "foo"; |
| 106 } | 106 } |
| 107 buildCounterBinding--; | 107 buildCounterBinding--; |
| 108 return o; | 108 return o; |
| 109 } | 109 } |
| 110 | 110 |
| 111 checkBinding(api.Binding o) { | 111 checkBinding(api.Binding o) { |
| 112 buildCounterBinding++; | 112 buildCounterBinding++; |
| 113 if (buildCounterBinding < 3) { | 113 if (buildCounterBinding < 3) { |
| 114 checkUnnamed1188(o.members); | 114 checkUnnamed1195(o.members); |
| 115 unittest.expect(o.role, unittest.equals('foo')); | 115 unittest.expect(o.role, unittest.equals('foo')); |
| 116 } | 116 } |
| 117 buildCounterBinding--; | 117 buildCounterBinding--; |
| 118 } | 118 } |
| 119 | 119 |
| 120 core.int buildCounterEmpty = 0; | 120 core.int buildCounterEmpty = 0; |
| 121 buildEmpty() { | 121 buildEmpty() { |
| 122 var o = new api.Empty(); | 122 var o = new api.Empty(); |
| 123 buildCounterEmpty++; | 123 buildCounterEmpty++; |
| 124 if (buildCounterEmpty < 3) { | 124 if (buildCounterEmpty < 3) { |
| 125 } | 125 } |
| 126 buildCounterEmpty--; | 126 buildCounterEmpty--; |
| 127 return o; | 127 return o; |
| 128 } | 128 } |
| 129 | 129 |
| 130 checkEmpty(api.Empty o) { | 130 checkEmpty(api.Empty o) { |
| 131 buildCounterEmpty++; | 131 buildCounterEmpty++; |
| 132 if (buildCounterEmpty < 3) { | 132 if (buildCounterEmpty < 3) { |
| 133 } | 133 } |
| 134 buildCounterEmpty--; | 134 buildCounterEmpty--; |
| 135 } | 135 } |
| 136 | 136 |
| 137 buildUnnamed1189() { | 137 buildUnnamed1196() { |
| 138 var o = new core.List<api.Subscription>(); | 138 var o = new core.List<api.Subscription>(); |
| 139 o.add(buildSubscription()); | 139 o.add(buildSubscription()); |
| 140 o.add(buildSubscription()); | 140 o.add(buildSubscription()); |
| 141 return o; | 141 return o; |
| 142 } | 142 } |
| 143 | 143 |
| 144 checkUnnamed1189(core.List<api.Subscription> o) { | 144 checkUnnamed1196(core.List<api.Subscription> o) { |
| 145 unittest.expect(o, unittest.hasLength(2)); | 145 unittest.expect(o, unittest.hasLength(2)); |
| 146 checkSubscription(o[0]); | 146 checkSubscription(o[0]); |
| 147 checkSubscription(o[1]); | 147 checkSubscription(o[1]); |
| 148 } | 148 } |
| 149 | 149 |
| 150 core.int buildCounterListSubscriptionsResponse = 0; | 150 core.int buildCounterListSubscriptionsResponse = 0; |
| 151 buildListSubscriptionsResponse() { | 151 buildListSubscriptionsResponse() { |
| 152 var o = new api.ListSubscriptionsResponse(); | 152 var o = new api.ListSubscriptionsResponse(); |
| 153 buildCounterListSubscriptionsResponse++; | 153 buildCounterListSubscriptionsResponse++; |
| 154 if (buildCounterListSubscriptionsResponse < 3) { | 154 if (buildCounterListSubscriptionsResponse < 3) { |
| 155 o.nextPageToken = "foo"; | 155 o.nextPageToken = "foo"; |
| 156 o.subscriptions = buildUnnamed1189(); | 156 o.subscriptions = buildUnnamed1196(); |
| 157 } | 157 } |
| 158 buildCounterListSubscriptionsResponse--; | 158 buildCounterListSubscriptionsResponse--; |
| 159 return o; | 159 return o; |
| 160 } | 160 } |
| 161 | 161 |
| 162 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { | 162 checkListSubscriptionsResponse(api.ListSubscriptionsResponse o) { |
| 163 buildCounterListSubscriptionsResponse++; | 163 buildCounterListSubscriptionsResponse++; |
| 164 if (buildCounterListSubscriptionsResponse < 3) { | 164 if (buildCounterListSubscriptionsResponse < 3) { |
| 165 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 165 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 166 checkUnnamed1189(o.subscriptions); | 166 checkUnnamed1196(o.subscriptions); |
| 167 } | 167 } |
| 168 buildCounterListSubscriptionsResponse--; | 168 buildCounterListSubscriptionsResponse--; |
| 169 } | 169 } |
| 170 | 170 |
| 171 buildUnnamed1190() { | 171 buildUnnamed1197() { |
| 172 var o = new core.List<core.String>(); | 172 var o = new core.List<core.String>(); |
| 173 o.add("foo"); | 173 o.add("foo"); |
| 174 o.add("foo"); | 174 o.add("foo"); |
| 175 return o; | 175 return o; |
| 176 } | 176 } |
| 177 | 177 |
| 178 checkUnnamed1190(core.List<core.String> o) { | 178 checkUnnamed1197(core.List<core.String> o) { |
| 179 unittest.expect(o, unittest.hasLength(2)); | 179 unittest.expect(o, unittest.hasLength(2)); |
| 180 unittest.expect(o[0], unittest.equals('foo')); | 180 unittest.expect(o[0], unittest.equals('foo')); |
| 181 unittest.expect(o[1], unittest.equals('foo')); | 181 unittest.expect(o[1], unittest.equals('foo')); |
| 182 } | 182 } |
| 183 | 183 |
| 184 core.int buildCounterListTopicSubscriptionsResponse = 0; | 184 core.int buildCounterListTopicSubscriptionsResponse = 0; |
| 185 buildListTopicSubscriptionsResponse() { | 185 buildListTopicSubscriptionsResponse() { |
| 186 var o = new api.ListTopicSubscriptionsResponse(); | 186 var o = new api.ListTopicSubscriptionsResponse(); |
| 187 buildCounterListTopicSubscriptionsResponse++; | 187 buildCounterListTopicSubscriptionsResponse++; |
| 188 if (buildCounterListTopicSubscriptionsResponse < 3) { | 188 if (buildCounterListTopicSubscriptionsResponse < 3) { |
| 189 o.nextPageToken = "foo"; | 189 o.nextPageToken = "foo"; |
| 190 o.subscriptions = buildUnnamed1190(); | 190 o.subscriptions = buildUnnamed1197(); |
| 191 } | 191 } |
| 192 buildCounterListTopicSubscriptionsResponse--; | 192 buildCounterListTopicSubscriptionsResponse--; |
| 193 return o; | 193 return o; |
| 194 } | 194 } |
| 195 | 195 |
| 196 checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) { | 196 checkListTopicSubscriptionsResponse(api.ListTopicSubscriptionsResponse o) { |
| 197 buildCounterListTopicSubscriptionsResponse++; | 197 buildCounterListTopicSubscriptionsResponse++; |
| 198 if (buildCounterListTopicSubscriptionsResponse < 3) { | 198 if (buildCounterListTopicSubscriptionsResponse < 3) { |
| 199 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 199 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 200 checkUnnamed1190(o.subscriptions); | 200 checkUnnamed1197(o.subscriptions); |
| 201 } | 201 } |
| 202 buildCounterListTopicSubscriptionsResponse--; | 202 buildCounterListTopicSubscriptionsResponse--; |
| 203 } | 203 } |
| 204 | 204 |
| 205 buildUnnamed1191() { | 205 buildUnnamed1198() { |
| 206 var o = new core.List<api.Topic>(); | 206 var o = new core.List<api.Topic>(); |
| 207 o.add(buildTopic()); | 207 o.add(buildTopic()); |
| 208 o.add(buildTopic()); | 208 o.add(buildTopic()); |
| 209 return o; | 209 return o; |
| 210 } | 210 } |
| 211 | 211 |
| 212 checkUnnamed1191(core.List<api.Topic> o) { | 212 checkUnnamed1198(core.List<api.Topic> o) { |
| 213 unittest.expect(o, unittest.hasLength(2)); | 213 unittest.expect(o, unittest.hasLength(2)); |
| 214 checkTopic(o[0]); | 214 checkTopic(o[0]); |
| 215 checkTopic(o[1]); | 215 checkTopic(o[1]); |
| 216 } | 216 } |
| 217 | 217 |
| 218 core.int buildCounterListTopicsResponse = 0; | 218 core.int buildCounterListTopicsResponse = 0; |
| 219 buildListTopicsResponse() { | 219 buildListTopicsResponse() { |
| 220 var o = new api.ListTopicsResponse(); | 220 var o = new api.ListTopicsResponse(); |
| 221 buildCounterListTopicsResponse++; | 221 buildCounterListTopicsResponse++; |
| 222 if (buildCounterListTopicsResponse < 3) { | 222 if (buildCounterListTopicsResponse < 3) { |
| 223 o.nextPageToken = "foo"; | 223 o.nextPageToken = "foo"; |
| 224 o.topics = buildUnnamed1191(); | 224 o.topics = buildUnnamed1198(); |
| 225 } | 225 } |
| 226 buildCounterListTopicsResponse--; | 226 buildCounterListTopicsResponse--; |
| 227 return o; | 227 return o; |
| 228 } | 228 } |
| 229 | 229 |
| 230 checkListTopicsResponse(api.ListTopicsResponse o) { | 230 checkListTopicsResponse(api.ListTopicsResponse o) { |
| 231 buildCounterListTopicsResponse++; | 231 buildCounterListTopicsResponse++; |
| 232 if (buildCounterListTopicsResponse < 3) { | 232 if (buildCounterListTopicsResponse < 3) { |
| 233 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 233 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 234 checkUnnamed1191(o.topics); | 234 checkUnnamed1198(o.topics); |
| 235 } | 235 } |
| 236 buildCounterListTopicsResponse--; | 236 buildCounterListTopicsResponse--; |
| 237 } | 237 } |
| 238 | 238 |
| 239 buildUnnamed1192() { | 239 buildUnnamed1199() { |
| 240 var o = new core.List<core.String>(); | 240 var o = new core.List<core.String>(); |
| 241 o.add("foo"); | 241 o.add("foo"); |
| 242 o.add("foo"); | 242 o.add("foo"); |
| 243 return o; | 243 return o; |
| 244 } | 244 } |
| 245 | 245 |
| 246 checkUnnamed1192(core.List<core.String> o) { | 246 checkUnnamed1199(core.List<core.String> o) { |
| 247 unittest.expect(o, unittest.hasLength(2)); | 247 unittest.expect(o, unittest.hasLength(2)); |
| 248 unittest.expect(o[0], unittest.equals('foo')); | 248 unittest.expect(o[0], unittest.equals('foo')); |
| 249 unittest.expect(o[1], unittest.equals('foo')); | 249 unittest.expect(o[1], unittest.equals('foo')); |
| 250 } | 250 } |
| 251 | 251 |
| 252 core.int buildCounterModifyAckDeadlineRequest = 0; | 252 core.int buildCounterModifyAckDeadlineRequest = 0; |
| 253 buildModifyAckDeadlineRequest() { | 253 buildModifyAckDeadlineRequest() { |
| 254 var o = new api.ModifyAckDeadlineRequest(); | 254 var o = new api.ModifyAckDeadlineRequest(); |
| 255 buildCounterModifyAckDeadlineRequest++; | 255 buildCounterModifyAckDeadlineRequest++; |
| 256 if (buildCounterModifyAckDeadlineRequest < 3) { | 256 if (buildCounterModifyAckDeadlineRequest < 3) { |
| 257 o.ackDeadlineSeconds = 42; | 257 o.ackDeadlineSeconds = 42; |
| 258 o.ackIds = buildUnnamed1192(); | 258 o.ackIds = buildUnnamed1199(); |
| 259 } | 259 } |
| 260 buildCounterModifyAckDeadlineRequest--; | 260 buildCounterModifyAckDeadlineRequest--; |
| 261 return o; | 261 return o; |
| 262 } | 262 } |
| 263 | 263 |
| 264 checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) { | 264 checkModifyAckDeadlineRequest(api.ModifyAckDeadlineRequest o) { |
| 265 buildCounterModifyAckDeadlineRequest++; | 265 buildCounterModifyAckDeadlineRequest++; |
| 266 if (buildCounterModifyAckDeadlineRequest < 3) { | 266 if (buildCounterModifyAckDeadlineRequest < 3) { |
| 267 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); | 267 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); |
| 268 checkUnnamed1192(o.ackIds); | 268 checkUnnamed1199(o.ackIds); |
| 269 } | 269 } |
| 270 buildCounterModifyAckDeadlineRequest--; | 270 buildCounterModifyAckDeadlineRequest--; |
| 271 } | 271 } |
| 272 | 272 |
| 273 core.int buildCounterModifyPushConfigRequest = 0; | 273 core.int buildCounterModifyPushConfigRequest = 0; |
| 274 buildModifyPushConfigRequest() { | 274 buildModifyPushConfigRequest() { |
| 275 var o = new api.ModifyPushConfigRequest(); | 275 var o = new api.ModifyPushConfigRequest(); |
| 276 buildCounterModifyPushConfigRequest++; | 276 buildCounterModifyPushConfigRequest++; |
| 277 if (buildCounterModifyPushConfigRequest < 3) { | 277 if (buildCounterModifyPushConfigRequest < 3) { |
| 278 o.pushConfig = buildPushConfig(); | 278 o.pushConfig = buildPushConfig(); |
| 279 } | 279 } |
| 280 buildCounterModifyPushConfigRequest--; | 280 buildCounterModifyPushConfigRequest--; |
| 281 return o; | 281 return o; |
| 282 } | 282 } |
| 283 | 283 |
| 284 checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) { | 284 checkModifyPushConfigRequest(api.ModifyPushConfigRequest o) { |
| 285 buildCounterModifyPushConfigRequest++; | 285 buildCounterModifyPushConfigRequest++; |
| 286 if (buildCounterModifyPushConfigRequest < 3) { | 286 if (buildCounterModifyPushConfigRequest < 3) { |
| 287 checkPushConfig(o.pushConfig); | 287 checkPushConfig(o.pushConfig); |
| 288 } | 288 } |
| 289 buildCounterModifyPushConfigRequest--; | 289 buildCounterModifyPushConfigRequest--; |
| 290 } | 290 } |
| 291 | 291 |
| 292 buildUnnamed1193() { | 292 buildUnnamed1200() { |
| 293 var o = new core.List<api.Binding>(); | 293 var o = new core.List<api.Binding>(); |
| 294 o.add(buildBinding()); | 294 o.add(buildBinding()); |
| 295 o.add(buildBinding()); | 295 o.add(buildBinding()); |
| 296 return o; | 296 return o; |
| 297 } | 297 } |
| 298 | 298 |
| 299 checkUnnamed1193(core.List<api.Binding> o) { | 299 checkUnnamed1200(core.List<api.Binding> o) { |
| 300 unittest.expect(o, unittest.hasLength(2)); | 300 unittest.expect(o, unittest.hasLength(2)); |
| 301 checkBinding(o[0]); | 301 checkBinding(o[0]); |
| 302 checkBinding(o[1]); | 302 checkBinding(o[1]); |
| 303 } | 303 } |
| 304 | 304 |
| 305 core.int buildCounterPolicy = 0; | 305 core.int buildCounterPolicy = 0; |
| 306 buildPolicy() { | 306 buildPolicy() { |
| 307 var o = new api.Policy(); | 307 var o = new api.Policy(); |
| 308 buildCounterPolicy++; | 308 buildCounterPolicy++; |
| 309 if (buildCounterPolicy < 3) { | 309 if (buildCounterPolicy < 3) { |
| 310 o.bindings = buildUnnamed1193(); | 310 o.bindings = buildUnnamed1200(); |
| 311 o.etag = "foo"; | 311 o.etag = "foo"; |
| 312 o.version = 42; | 312 o.version = 42; |
| 313 } | 313 } |
| 314 buildCounterPolicy--; | 314 buildCounterPolicy--; |
| 315 return o; | 315 return o; |
| 316 } | 316 } |
| 317 | 317 |
| 318 checkPolicy(api.Policy o) { | 318 checkPolicy(api.Policy o) { |
| 319 buildCounterPolicy++; | 319 buildCounterPolicy++; |
| 320 if (buildCounterPolicy < 3) { | 320 if (buildCounterPolicy < 3) { |
| 321 checkUnnamed1193(o.bindings); | 321 checkUnnamed1200(o.bindings); |
| 322 unittest.expect(o.etag, unittest.equals('foo')); | 322 unittest.expect(o.etag, unittest.equals('foo')); |
| 323 unittest.expect(o.version, unittest.equals(42)); | 323 unittest.expect(o.version, unittest.equals(42)); |
| 324 } | 324 } |
| 325 buildCounterPolicy--; | 325 buildCounterPolicy--; |
| 326 } | 326 } |
| 327 | 327 |
| 328 buildUnnamed1194() { | 328 buildUnnamed1201() { |
| 329 var o = new core.List<api.PubsubMessage>(); | 329 var o = new core.List<api.PubsubMessage>(); |
| 330 o.add(buildPubsubMessage()); | 330 o.add(buildPubsubMessage()); |
| 331 o.add(buildPubsubMessage()); | 331 o.add(buildPubsubMessage()); |
| 332 return o; | 332 return o; |
| 333 } | 333 } |
| 334 | 334 |
| 335 checkUnnamed1194(core.List<api.PubsubMessage> o) { | 335 checkUnnamed1201(core.List<api.PubsubMessage> o) { |
| 336 unittest.expect(o, unittest.hasLength(2)); | 336 unittest.expect(o, unittest.hasLength(2)); |
| 337 checkPubsubMessage(o[0]); | 337 checkPubsubMessage(o[0]); |
| 338 checkPubsubMessage(o[1]); | 338 checkPubsubMessage(o[1]); |
| 339 } | 339 } |
| 340 | 340 |
| 341 core.int buildCounterPublishRequest = 0; | 341 core.int buildCounterPublishRequest = 0; |
| 342 buildPublishRequest() { | 342 buildPublishRequest() { |
| 343 var o = new api.PublishRequest(); | 343 var o = new api.PublishRequest(); |
| 344 buildCounterPublishRequest++; | 344 buildCounterPublishRequest++; |
| 345 if (buildCounterPublishRequest < 3) { | 345 if (buildCounterPublishRequest < 3) { |
| 346 o.messages = buildUnnamed1194(); | 346 o.messages = buildUnnamed1201(); |
| 347 } | 347 } |
| 348 buildCounterPublishRequest--; | 348 buildCounterPublishRequest--; |
| 349 return o; | 349 return o; |
| 350 } | 350 } |
| 351 | 351 |
| 352 checkPublishRequest(api.PublishRequest o) { | 352 checkPublishRequest(api.PublishRequest o) { |
| 353 buildCounterPublishRequest++; | 353 buildCounterPublishRequest++; |
| 354 if (buildCounterPublishRequest < 3) { | 354 if (buildCounterPublishRequest < 3) { |
| 355 checkUnnamed1194(o.messages); | 355 checkUnnamed1201(o.messages); |
| 356 } | 356 } |
| 357 buildCounterPublishRequest--; | 357 buildCounterPublishRequest--; |
| 358 } | 358 } |
| 359 | 359 |
| 360 buildUnnamed1195() { | 360 buildUnnamed1202() { |
| 361 var o = new core.List<core.String>(); | 361 var o = new core.List<core.String>(); |
| 362 o.add("foo"); | 362 o.add("foo"); |
| 363 o.add("foo"); | 363 o.add("foo"); |
| 364 return o; | 364 return o; |
| 365 } | 365 } |
| 366 | 366 |
| 367 checkUnnamed1195(core.List<core.String> o) { | 367 checkUnnamed1202(core.List<core.String> o) { |
| 368 unittest.expect(o, unittest.hasLength(2)); | 368 unittest.expect(o, unittest.hasLength(2)); |
| 369 unittest.expect(o[0], unittest.equals('foo')); | 369 unittest.expect(o[0], unittest.equals('foo')); |
| 370 unittest.expect(o[1], unittest.equals('foo')); | 370 unittest.expect(o[1], unittest.equals('foo')); |
| 371 } | 371 } |
| 372 | 372 |
| 373 core.int buildCounterPublishResponse = 0; | 373 core.int buildCounterPublishResponse = 0; |
| 374 buildPublishResponse() { | 374 buildPublishResponse() { |
| 375 var o = new api.PublishResponse(); | 375 var o = new api.PublishResponse(); |
| 376 buildCounterPublishResponse++; | 376 buildCounterPublishResponse++; |
| 377 if (buildCounterPublishResponse < 3) { | 377 if (buildCounterPublishResponse < 3) { |
| 378 o.messageIds = buildUnnamed1195(); | 378 o.messageIds = buildUnnamed1202(); |
| 379 } | 379 } |
| 380 buildCounterPublishResponse--; | 380 buildCounterPublishResponse--; |
| 381 return o; | 381 return o; |
| 382 } | 382 } |
| 383 | 383 |
| 384 checkPublishResponse(api.PublishResponse o) { | 384 checkPublishResponse(api.PublishResponse o) { |
| 385 buildCounterPublishResponse++; | 385 buildCounterPublishResponse++; |
| 386 if (buildCounterPublishResponse < 3) { | 386 if (buildCounterPublishResponse < 3) { |
| 387 checkUnnamed1195(o.messageIds); | 387 checkUnnamed1202(o.messageIds); |
| 388 } | 388 } |
| 389 buildCounterPublishResponse--; | 389 buildCounterPublishResponse--; |
| 390 } | 390 } |
| 391 | 391 |
| 392 buildUnnamed1196() { | 392 buildUnnamed1203() { |
| 393 var o = new core.Map<core.String, core.String>(); | 393 var o = new core.Map<core.String, core.String>(); |
| 394 o["x"] = "foo"; | 394 o["x"] = "foo"; |
| 395 o["y"] = "foo"; | 395 o["y"] = "foo"; |
| 396 return o; | 396 return o; |
| 397 } | 397 } |
| 398 | 398 |
| 399 checkUnnamed1196(core.Map<core.String, core.String> o) { | 399 checkUnnamed1203(core.Map<core.String, core.String> o) { |
| 400 unittest.expect(o, unittest.hasLength(2)); | 400 unittest.expect(o, unittest.hasLength(2)); |
| 401 unittest.expect(o["x"], unittest.equals('foo')); | 401 unittest.expect(o["x"], unittest.equals('foo')); |
| 402 unittest.expect(o["y"], unittest.equals('foo')); | 402 unittest.expect(o["y"], unittest.equals('foo')); |
| 403 } | 403 } |
| 404 | 404 |
| 405 core.int buildCounterPubsubMessage = 0; | 405 core.int buildCounterPubsubMessage = 0; |
| 406 buildPubsubMessage() { | 406 buildPubsubMessage() { |
| 407 var o = new api.PubsubMessage(); | 407 var o = new api.PubsubMessage(); |
| 408 buildCounterPubsubMessage++; | 408 buildCounterPubsubMessage++; |
| 409 if (buildCounterPubsubMessage < 3) { | 409 if (buildCounterPubsubMessage < 3) { |
| 410 o.attributes = buildUnnamed1196(); | 410 o.attributes = buildUnnamed1203(); |
| 411 o.data = "foo"; | 411 o.data = "foo"; |
| 412 o.messageId = "foo"; | 412 o.messageId = "foo"; |
| 413 o.publishTime = "foo"; | 413 o.publishTime = "foo"; |
| 414 } | 414 } |
| 415 buildCounterPubsubMessage--; | 415 buildCounterPubsubMessage--; |
| 416 return o; | 416 return o; |
| 417 } | 417 } |
| 418 | 418 |
| 419 checkPubsubMessage(api.PubsubMessage o) { | 419 checkPubsubMessage(api.PubsubMessage o) { |
| 420 buildCounterPubsubMessage++; | 420 buildCounterPubsubMessage++; |
| 421 if (buildCounterPubsubMessage < 3) { | 421 if (buildCounterPubsubMessage < 3) { |
| 422 checkUnnamed1196(o.attributes); | 422 checkUnnamed1203(o.attributes); |
| 423 unittest.expect(o.data, unittest.equals('foo')); | 423 unittest.expect(o.data, unittest.equals('foo')); |
| 424 unittest.expect(o.messageId, unittest.equals('foo')); | 424 unittest.expect(o.messageId, unittest.equals('foo')); |
| 425 unittest.expect(o.publishTime, unittest.equals('foo')); | 425 unittest.expect(o.publishTime, unittest.equals('foo')); |
| 426 } | 426 } |
| 427 buildCounterPubsubMessage--; | 427 buildCounterPubsubMessage--; |
| 428 } | 428 } |
| 429 | 429 |
| 430 core.int buildCounterPullRequest = 0; | 430 core.int buildCounterPullRequest = 0; |
| 431 buildPullRequest() { | 431 buildPullRequest() { |
| 432 var o = new api.PullRequest(); | 432 var o = new api.PullRequest(); |
| 433 buildCounterPullRequest++; | 433 buildCounterPullRequest++; |
| 434 if (buildCounterPullRequest < 3) { | 434 if (buildCounterPullRequest < 3) { |
| 435 o.maxMessages = 42; | 435 o.maxMessages = 42; |
| 436 o.returnImmediately = true; | 436 o.returnImmediately = true; |
| 437 } | 437 } |
| 438 buildCounterPullRequest--; | 438 buildCounterPullRequest--; |
| 439 return o; | 439 return o; |
| 440 } | 440 } |
| 441 | 441 |
| 442 checkPullRequest(api.PullRequest o) { | 442 checkPullRequest(api.PullRequest o) { |
| 443 buildCounterPullRequest++; | 443 buildCounterPullRequest++; |
| 444 if (buildCounterPullRequest < 3) { | 444 if (buildCounterPullRequest < 3) { |
| 445 unittest.expect(o.maxMessages, unittest.equals(42)); | 445 unittest.expect(o.maxMessages, unittest.equals(42)); |
| 446 unittest.expect(o.returnImmediately, unittest.isTrue); | 446 unittest.expect(o.returnImmediately, unittest.isTrue); |
| 447 } | 447 } |
| 448 buildCounterPullRequest--; | 448 buildCounterPullRequest--; |
| 449 } | 449 } |
| 450 | 450 |
| 451 buildUnnamed1197() { | 451 buildUnnamed1204() { |
| 452 var o = new core.List<api.ReceivedMessage>(); | 452 var o = new core.List<api.ReceivedMessage>(); |
| 453 o.add(buildReceivedMessage()); | 453 o.add(buildReceivedMessage()); |
| 454 o.add(buildReceivedMessage()); | 454 o.add(buildReceivedMessage()); |
| 455 return o; | 455 return o; |
| 456 } | 456 } |
| 457 | 457 |
| 458 checkUnnamed1197(core.List<api.ReceivedMessage> o) { | 458 checkUnnamed1204(core.List<api.ReceivedMessage> o) { |
| 459 unittest.expect(o, unittest.hasLength(2)); | 459 unittest.expect(o, unittest.hasLength(2)); |
| 460 checkReceivedMessage(o[0]); | 460 checkReceivedMessage(o[0]); |
| 461 checkReceivedMessage(o[1]); | 461 checkReceivedMessage(o[1]); |
| 462 } | 462 } |
| 463 | 463 |
| 464 core.int buildCounterPullResponse = 0; | 464 core.int buildCounterPullResponse = 0; |
| 465 buildPullResponse() { | 465 buildPullResponse() { |
| 466 var o = new api.PullResponse(); | 466 var o = new api.PullResponse(); |
| 467 buildCounterPullResponse++; | 467 buildCounterPullResponse++; |
| 468 if (buildCounterPullResponse < 3) { | 468 if (buildCounterPullResponse < 3) { |
| 469 o.receivedMessages = buildUnnamed1197(); | 469 o.receivedMessages = buildUnnamed1204(); |
| 470 } | 470 } |
| 471 buildCounterPullResponse--; | 471 buildCounterPullResponse--; |
| 472 return o; | 472 return o; |
| 473 } | 473 } |
| 474 | 474 |
| 475 checkPullResponse(api.PullResponse o) { | 475 checkPullResponse(api.PullResponse o) { |
| 476 buildCounterPullResponse++; | 476 buildCounterPullResponse++; |
| 477 if (buildCounterPullResponse < 3) { | 477 if (buildCounterPullResponse < 3) { |
| 478 checkUnnamed1197(o.receivedMessages); | 478 checkUnnamed1204(o.receivedMessages); |
| 479 } | 479 } |
| 480 buildCounterPullResponse--; | 480 buildCounterPullResponse--; |
| 481 } | 481 } |
| 482 | 482 |
| 483 buildUnnamed1198() { | 483 buildUnnamed1205() { |
| 484 var o = new core.Map<core.String, core.String>(); | 484 var o = new core.Map<core.String, core.String>(); |
| 485 o["x"] = "foo"; | 485 o["x"] = "foo"; |
| 486 o["y"] = "foo"; | 486 o["y"] = "foo"; |
| 487 return o; | 487 return o; |
| 488 } | 488 } |
| 489 | 489 |
| 490 checkUnnamed1198(core.Map<core.String, core.String> o) { | 490 checkUnnamed1205(core.Map<core.String, core.String> o) { |
| 491 unittest.expect(o, unittest.hasLength(2)); | 491 unittest.expect(o, unittest.hasLength(2)); |
| 492 unittest.expect(o["x"], unittest.equals('foo')); | 492 unittest.expect(o["x"], unittest.equals('foo')); |
| 493 unittest.expect(o["y"], unittest.equals('foo')); | 493 unittest.expect(o["y"], unittest.equals('foo')); |
| 494 } | 494 } |
| 495 | 495 |
| 496 core.int buildCounterPushConfig = 0; | 496 core.int buildCounterPushConfig = 0; |
| 497 buildPushConfig() { | 497 buildPushConfig() { |
| 498 var o = new api.PushConfig(); | 498 var o = new api.PushConfig(); |
| 499 buildCounterPushConfig++; | 499 buildCounterPushConfig++; |
| 500 if (buildCounterPushConfig < 3) { | 500 if (buildCounterPushConfig < 3) { |
| 501 o.attributes = buildUnnamed1198(); | 501 o.attributes = buildUnnamed1205(); |
| 502 o.pushEndpoint = "foo"; | 502 o.pushEndpoint = "foo"; |
| 503 } | 503 } |
| 504 buildCounterPushConfig--; | 504 buildCounterPushConfig--; |
| 505 return o; | 505 return o; |
| 506 } | 506 } |
| 507 | 507 |
| 508 checkPushConfig(api.PushConfig o) { | 508 checkPushConfig(api.PushConfig o) { |
| 509 buildCounterPushConfig++; | 509 buildCounterPushConfig++; |
| 510 if (buildCounterPushConfig < 3) { | 510 if (buildCounterPushConfig < 3) { |
| 511 checkUnnamed1198(o.attributes); | 511 checkUnnamed1205(o.attributes); |
| 512 unittest.expect(o.pushEndpoint, unittest.equals('foo')); | 512 unittest.expect(o.pushEndpoint, unittest.equals('foo')); |
| 513 } | 513 } |
| 514 buildCounterPushConfig--; | 514 buildCounterPushConfig--; |
| 515 } | 515 } |
| 516 | 516 |
| 517 core.int buildCounterReceivedMessage = 0; | 517 core.int buildCounterReceivedMessage = 0; |
| 518 buildReceivedMessage() { | 518 buildReceivedMessage() { |
| 519 var o = new api.ReceivedMessage(); | 519 var o = new api.ReceivedMessage(); |
| 520 buildCounterReceivedMessage++; | 520 buildCounterReceivedMessage++; |
| 521 if (buildCounterReceivedMessage < 3) { | 521 if (buildCounterReceivedMessage < 3) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 buildCounterSubscription++; | 572 buildCounterSubscription++; |
| 573 if (buildCounterSubscription < 3) { | 573 if (buildCounterSubscription < 3) { |
| 574 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); | 574 unittest.expect(o.ackDeadlineSeconds, unittest.equals(42)); |
| 575 unittest.expect(o.name, unittest.equals('foo')); | 575 unittest.expect(o.name, unittest.equals('foo')); |
| 576 checkPushConfig(o.pushConfig); | 576 checkPushConfig(o.pushConfig); |
| 577 unittest.expect(o.topic, unittest.equals('foo')); | 577 unittest.expect(o.topic, unittest.equals('foo')); |
| 578 } | 578 } |
| 579 buildCounterSubscription--; | 579 buildCounterSubscription--; |
| 580 } | 580 } |
| 581 | 581 |
| 582 buildUnnamed1199() { | 582 buildUnnamed1206() { |
| 583 var o = new core.List<core.String>(); | 583 var o = new core.List<core.String>(); |
| 584 o.add("foo"); | 584 o.add("foo"); |
| 585 o.add("foo"); | 585 o.add("foo"); |
| 586 return o; | 586 return o; |
| 587 } | 587 } |
| 588 | 588 |
| 589 checkUnnamed1199(core.List<core.String> o) { | 589 checkUnnamed1206(core.List<core.String> o) { |
| 590 unittest.expect(o, unittest.hasLength(2)); | 590 unittest.expect(o, unittest.hasLength(2)); |
| 591 unittest.expect(o[0], unittest.equals('foo')); | 591 unittest.expect(o[0], unittest.equals('foo')); |
| 592 unittest.expect(o[1], unittest.equals('foo')); | 592 unittest.expect(o[1], unittest.equals('foo')); |
| 593 } | 593 } |
| 594 | 594 |
| 595 core.int buildCounterTestIamPermissionsRequest = 0; | 595 core.int buildCounterTestIamPermissionsRequest = 0; |
| 596 buildTestIamPermissionsRequest() { | 596 buildTestIamPermissionsRequest() { |
| 597 var o = new api.TestIamPermissionsRequest(); | 597 var o = new api.TestIamPermissionsRequest(); |
| 598 buildCounterTestIamPermissionsRequest++; | 598 buildCounterTestIamPermissionsRequest++; |
| 599 if (buildCounterTestIamPermissionsRequest < 3) { | 599 if (buildCounterTestIamPermissionsRequest < 3) { |
| 600 o.permissions = buildUnnamed1199(); | 600 o.permissions = buildUnnamed1206(); |
| 601 } | 601 } |
| 602 buildCounterTestIamPermissionsRequest--; | 602 buildCounterTestIamPermissionsRequest--; |
| 603 return o; | 603 return o; |
| 604 } | 604 } |
| 605 | 605 |
| 606 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { | 606 checkTestIamPermissionsRequest(api.TestIamPermissionsRequest o) { |
| 607 buildCounterTestIamPermissionsRequest++; | 607 buildCounterTestIamPermissionsRequest++; |
| 608 if (buildCounterTestIamPermissionsRequest < 3) { | 608 if (buildCounterTestIamPermissionsRequest < 3) { |
| 609 checkUnnamed1199(o.permissions); | 609 checkUnnamed1206(o.permissions); |
| 610 } | 610 } |
| 611 buildCounterTestIamPermissionsRequest--; | 611 buildCounterTestIamPermissionsRequest--; |
| 612 } | 612 } |
| 613 | 613 |
| 614 buildUnnamed1200() { | 614 buildUnnamed1207() { |
| 615 var o = new core.List<core.String>(); | 615 var o = new core.List<core.String>(); |
| 616 o.add("foo"); | 616 o.add("foo"); |
| 617 o.add("foo"); | 617 o.add("foo"); |
| 618 return o; | 618 return o; |
| 619 } | 619 } |
| 620 | 620 |
| 621 checkUnnamed1200(core.List<core.String> o) { | 621 checkUnnamed1207(core.List<core.String> o) { |
| 622 unittest.expect(o, unittest.hasLength(2)); | 622 unittest.expect(o, unittest.hasLength(2)); |
| 623 unittest.expect(o[0], unittest.equals('foo')); | 623 unittest.expect(o[0], unittest.equals('foo')); |
| 624 unittest.expect(o[1], unittest.equals('foo')); | 624 unittest.expect(o[1], unittest.equals('foo')); |
| 625 } | 625 } |
| 626 | 626 |
| 627 core.int buildCounterTestIamPermissionsResponse = 0; | 627 core.int buildCounterTestIamPermissionsResponse = 0; |
| 628 buildTestIamPermissionsResponse() { | 628 buildTestIamPermissionsResponse() { |
| 629 var o = new api.TestIamPermissionsResponse(); | 629 var o = new api.TestIamPermissionsResponse(); |
| 630 buildCounterTestIamPermissionsResponse++; | 630 buildCounterTestIamPermissionsResponse++; |
| 631 if (buildCounterTestIamPermissionsResponse < 3) { | 631 if (buildCounterTestIamPermissionsResponse < 3) { |
| 632 o.permissions = buildUnnamed1200(); | 632 o.permissions = buildUnnamed1207(); |
| 633 } | 633 } |
| 634 buildCounterTestIamPermissionsResponse--; | 634 buildCounterTestIamPermissionsResponse--; |
| 635 return o; | 635 return o; |
| 636 } | 636 } |
| 637 | 637 |
| 638 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { | 638 checkTestIamPermissionsResponse(api.TestIamPermissionsResponse o) { |
| 639 buildCounterTestIamPermissionsResponse++; | 639 buildCounterTestIamPermissionsResponse++; |
| 640 if (buildCounterTestIamPermissionsResponse < 3) { | 640 if (buildCounterTestIamPermissionsResponse < 3) { |
| 641 checkUnnamed1200(o.permissions); | 641 checkUnnamed1207(o.permissions); |
| 642 } | 642 } |
| 643 buildCounterTestIamPermissionsResponse--; | 643 buildCounterTestIamPermissionsResponse--; |
| 644 } | 644 } |
| 645 | 645 |
| 646 core.int buildCounterTopic = 0; | 646 core.int buildCounterTopic = 0; |
| 647 buildTopic() { | 647 buildTopic() { |
| 648 var o = new api.Topic(); | 648 var o = new api.Topic(); |
| 649 buildCounterTopic++; | 649 buildCounterTopic++; |
| 650 if (buildCounterTopic < 3) { | 650 if (buildCounterTopic < 3) { |
| 651 o.name = "foo"; | 651 o.name = "foo"; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 }); | 852 }); |
| 853 }); | 853 }); |
| 854 | 854 |
| 855 | 855 |
| 856 unittest.group("resource-ProjectsSnapshotsResourceApi", () { | 856 unittest.group("resource-ProjectsSnapshotsResourceApi", () { |
| 857 unittest.test("method--getIamPolicy", () { | 857 unittest.test("method--getIamPolicy", () { |
| 858 | 858 |
| 859 var mock = new HttpServerMock(); | 859 var mock = new HttpServerMock(); |
| 860 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn
apshots; | 860 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn
apshots; |
| 861 var arg_resource = "foo"; | 861 var arg_resource = "foo"; |
| 862 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 862 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 863 var path = (req.url).path; | 863 var path = (req.url).path; |
| 864 var pathOffset = 0; | 864 var pathOffset = 0; |
| 865 var index; | 865 var index; |
| 866 var subPart; | 866 var subPart; |
| 867 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 867 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 868 pathOffset += 1; | 868 pathOffset += 1; |
| 869 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 869 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 870 pathOffset += 3; | 870 pathOffset += 3; |
| 871 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 871 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 872 | 872 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 887 } | 887 } |
| 888 } | 888 } |
| 889 | 889 |
| 890 | 890 |
| 891 var h = { | 891 var h = { |
| 892 "content-type" : "application/json; charset=utf-8", | 892 "content-type" : "application/json; charset=utf-8", |
| 893 }; | 893 }; |
| 894 var resp = convert.JSON.encode(buildPolicy()); | 894 var resp = convert.JSON.encode(buildPolicy()); |
| 895 return new async.Future.value(stringResponse(200, h, resp)); | 895 return new async.Future.value(stringResponse(200, h, resp)); |
| 896 }), true); | 896 }), true); |
| 897 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp
onse) { | 897 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res
ponse) { |
| 898 checkPolicy(response); | 898 checkPolicy(response); |
| 899 }))); | 899 }))); |
| 900 }); | 900 }); |
| 901 | 901 |
| 902 unittest.test("method--setIamPolicy", () { | 902 unittest.test("method--setIamPolicy", () { |
| 903 | 903 |
| 904 var mock = new HttpServerMock(); | 904 var mock = new HttpServerMock(); |
| 905 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn
apshots; | 905 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn
apshots; |
| 906 var arg_request = buildSetIamPolicyRequest(); | 906 var arg_request = buildSetIamPolicyRequest(); |
| 907 var arg_resource = "foo"; | 907 var arg_resource = "foo"; |
| 908 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 908 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 909 var obj = new api.SetIamPolicyRequest.fromJson(json); | 909 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 910 checkSetIamPolicyRequest(obj); | 910 checkSetIamPolicyRequest(obj); |
| 911 | 911 |
| 912 var path = (req.url).path; | 912 var path = (req.url).path; |
| 913 var pathOffset = 0; | 913 var pathOffset = 0; |
| 914 var index; | 914 var index; |
| 915 var subPart; | 915 var subPart; |
| 916 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 916 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 917 pathOffset += 1; | 917 pathOffset += 1; |
| 918 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 918 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 936 } | 936 } |
| 937 } | 937 } |
| 938 | 938 |
| 939 | 939 |
| 940 var h = { | 940 var h = { |
| 941 "content-type" : "application/json; charset=utf-8", | 941 "content-type" : "application/json; charset=utf-8", |
| 942 }; | 942 }; |
| 943 var resp = convert.JSON.encode(buildPolicy()); | 943 var resp = convert.JSON.encode(buildPolicy()); |
| 944 return new async.Future.value(stringResponse(200, h, resp)); | 944 return new async.Future.value(stringResponse(200, h, resp)); |
| 945 }), true); | 945 }), true); |
| 946 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 946 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 947 checkPolicy(response); | 947 checkPolicy(response); |
| 948 }))); | 948 }))); |
| 949 }); | 949 }); |
| 950 | 950 |
| 951 unittest.test("method--testIamPermissions", () { | 951 unittest.test("method--testIamPermissions", () { |
| 952 | 952 |
| 953 var mock = new HttpServerMock(); | 953 var mock = new HttpServerMock(); |
| 954 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn
apshots; | 954 api.ProjectsSnapshotsResourceApi res = new api.PubsubApi(mock).projects.sn
apshots; |
| 955 var arg_request = buildTestIamPermissionsRequest(); | 955 var arg_request = buildTestIamPermissionsRequest(); |
| 956 var arg_resource = "foo"; | 956 var arg_resource = "foo"; |
| 957 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 957 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 958 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 958 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 959 checkTestIamPermissionsRequest(obj); | 959 checkTestIamPermissionsRequest(obj); |
| 960 | 960 |
| 961 var path = (req.url).path; | 961 var path = (req.url).path; |
| 962 var pathOffset = 0; | 962 var pathOffset = 0; |
| 963 var index; | 963 var index; |
| 964 var subPart; | 964 var subPart; |
| 965 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 965 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 966 pathOffset += 1; | 966 pathOffset += 1; |
| 967 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 967 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 985 } | 985 } |
| 986 } | 986 } |
| 987 | 987 |
| 988 | 988 |
| 989 var h = { | 989 var h = { |
| 990 "content-type" : "application/json; charset=utf-8", | 990 "content-type" : "application/json; charset=utf-8", |
| 991 }; | 991 }; |
| 992 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 992 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 993 return new async.Future.value(stringResponse(200, h, resp)); | 993 return new async.Future.value(stringResponse(200, h, resp)); |
| 994 }), true); | 994 }), true); |
| 995 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 995 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
| 996 checkTestIamPermissionsResponse(response); | 996 checkTestIamPermissionsResponse(response); |
| 997 }))); | 997 }))); |
| 998 }); | 998 }); |
| 999 | 999 |
| 1000 }); | 1000 }); |
| 1001 | 1001 |
| 1002 | 1002 |
| 1003 unittest.group("resource-ProjectsSubscriptionsResourceApi", () { | 1003 unittest.group("resource-ProjectsSubscriptionsResourceApi", () { |
| 1004 unittest.test("method--acknowledge", () { | 1004 unittest.test("method--acknowledge", () { |
| 1005 | 1005 |
| 1006 var mock = new HttpServerMock(); | 1006 var mock = new HttpServerMock(); |
| 1007 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1007 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1008 var arg_request = buildAcknowledgeRequest(); | 1008 var arg_request = buildAcknowledgeRequest(); |
| 1009 var arg_subscription = "foo"; | 1009 var arg_subscription = "foo"; |
| 1010 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1010 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1011 var obj = new api.AcknowledgeRequest.fromJson(json); | 1011 var obj = new api.AcknowledgeRequest.fromJson(json); |
| 1012 checkAcknowledgeRequest(obj); | 1012 checkAcknowledgeRequest(obj); |
| 1013 | 1013 |
| 1014 var path = (req.url).path; | 1014 var path = (req.url).path; |
| 1015 var pathOffset = 0; | 1015 var pathOffset = 0; |
| 1016 var index; | 1016 var index; |
| 1017 var subPart; | 1017 var subPart; |
| 1018 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1018 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1019 pathOffset += 1; | 1019 pathOffset += 1; |
| 1020 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1020 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1038 } | 1038 } |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 | 1041 |
| 1042 var h = { | 1042 var h = { |
| 1043 "content-type" : "application/json; charset=utf-8", | 1043 "content-type" : "application/json; charset=utf-8", |
| 1044 }; | 1044 }; |
| 1045 var resp = convert.JSON.encode(buildEmpty()); | 1045 var resp = convert.JSON.encode(buildEmpty()); |
| 1046 return new async.Future.value(stringResponse(200, h, resp)); | 1046 return new async.Future.value(stringResponse(200, h, resp)); |
| 1047 }), true); | 1047 }), true); |
| 1048 res.acknowledge(arg_request, arg_subscription).then(unittest.expectAsync((
(api.Empty response) { | 1048 res.acknowledge(arg_request, arg_subscription).then(unittest.expectAsync1(
((api.Empty response) { |
| 1049 checkEmpty(response); | 1049 checkEmpty(response); |
| 1050 }))); | 1050 }))); |
| 1051 }); | 1051 }); |
| 1052 | 1052 |
| 1053 unittest.test("method--create", () { | 1053 unittest.test("method--create", () { |
| 1054 | 1054 |
| 1055 var mock = new HttpServerMock(); | 1055 var mock = new HttpServerMock(); |
| 1056 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1056 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1057 var arg_request = buildSubscription(); | 1057 var arg_request = buildSubscription(); |
| 1058 var arg_name = "foo"; | 1058 var arg_name = "foo"; |
| 1059 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1059 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1060 var obj = new api.Subscription.fromJson(json); | 1060 var obj = new api.Subscription.fromJson(json); |
| 1061 checkSubscription(obj); | 1061 checkSubscription(obj); |
| 1062 | 1062 |
| 1063 var path = (req.url).path; | 1063 var path = (req.url).path; |
| 1064 var pathOffset = 0; | 1064 var pathOffset = 0; |
| 1065 var index; | 1065 var index; |
| 1066 var subPart; | 1066 var subPart; |
| 1067 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1067 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1068 pathOffset += 1; | 1068 pathOffset += 1; |
| 1069 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1069 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1087 } | 1087 } |
| 1088 } | 1088 } |
| 1089 | 1089 |
| 1090 | 1090 |
| 1091 var h = { | 1091 var h = { |
| 1092 "content-type" : "application/json; charset=utf-8", | 1092 "content-type" : "application/json; charset=utf-8", |
| 1093 }; | 1093 }; |
| 1094 var resp = convert.JSON.encode(buildSubscription()); | 1094 var resp = convert.JSON.encode(buildSubscription()); |
| 1095 return new async.Future.value(stringResponse(200, h, resp)); | 1095 return new async.Future.value(stringResponse(200, h, resp)); |
| 1096 }), true); | 1096 }), true); |
| 1097 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Subscrip
tion response) { | 1097 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Subscri
ption response) { |
| 1098 checkSubscription(response); | 1098 checkSubscription(response); |
| 1099 }))); | 1099 }))); |
| 1100 }); | 1100 }); |
| 1101 | 1101 |
| 1102 unittest.test("method--delete", () { | 1102 unittest.test("method--delete", () { |
| 1103 | 1103 |
| 1104 var mock = new HttpServerMock(); | 1104 var mock = new HttpServerMock(); |
| 1105 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1105 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1106 var arg_subscription = "foo"; | 1106 var arg_subscription = "foo"; |
| 1107 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1107 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1108 var path = (req.url).path; | 1108 var path = (req.url).path; |
| 1109 var pathOffset = 0; | 1109 var pathOffset = 0; |
| 1110 var index; | 1110 var index; |
| 1111 var subPart; | 1111 var subPart; |
| 1112 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1112 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1113 pathOffset += 1; | 1113 pathOffset += 1; |
| 1114 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1114 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1115 pathOffset += 3; | 1115 pathOffset += 3; |
| 1116 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1116 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1117 | 1117 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1132 } | 1132 } |
| 1133 } | 1133 } |
| 1134 | 1134 |
| 1135 | 1135 |
| 1136 var h = { | 1136 var h = { |
| 1137 "content-type" : "application/json; charset=utf-8", | 1137 "content-type" : "application/json; charset=utf-8", |
| 1138 }; | 1138 }; |
| 1139 var resp = convert.JSON.encode(buildEmpty()); | 1139 var resp = convert.JSON.encode(buildEmpty()); |
| 1140 return new async.Future.value(stringResponse(200, h, resp)); | 1140 return new async.Future.value(stringResponse(200, h, resp)); |
| 1141 }), true); | 1141 }), true); |
| 1142 res.delete(arg_subscription).then(unittest.expectAsync(((api.Empty respons
e) { | 1142 res.delete(arg_subscription).then(unittest.expectAsync1(((api.Empty respon
se) { |
| 1143 checkEmpty(response); | 1143 checkEmpty(response); |
| 1144 }))); | 1144 }))); |
| 1145 }); | 1145 }); |
| 1146 | 1146 |
| 1147 unittest.test("method--get", () { | 1147 unittest.test("method--get", () { |
| 1148 | 1148 |
| 1149 var mock = new HttpServerMock(); | 1149 var mock = new HttpServerMock(); |
| 1150 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1150 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1151 var arg_subscription = "foo"; | 1151 var arg_subscription = "foo"; |
| 1152 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1152 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1153 var path = (req.url).path; | 1153 var path = (req.url).path; |
| 1154 var pathOffset = 0; | 1154 var pathOffset = 0; |
| 1155 var index; | 1155 var index; |
| 1156 var subPart; | 1156 var subPart; |
| 1157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1157 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1158 pathOffset += 1; | 1158 pathOffset += 1; |
| 1159 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1159 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1160 pathOffset += 3; | 1160 pathOffset += 3; |
| 1161 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1161 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1162 | 1162 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1177 } | 1177 } |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 | 1180 |
| 1181 var h = { | 1181 var h = { |
| 1182 "content-type" : "application/json; charset=utf-8", | 1182 "content-type" : "application/json; charset=utf-8", |
| 1183 }; | 1183 }; |
| 1184 var resp = convert.JSON.encode(buildSubscription()); | 1184 var resp = convert.JSON.encode(buildSubscription()); |
| 1185 return new async.Future.value(stringResponse(200, h, resp)); | 1185 return new async.Future.value(stringResponse(200, h, resp)); |
| 1186 }), true); | 1186 }), true); |
| 1187 res.get(arg_subscription).then(unittest.expectAsync(((api.Subscription res
ponse) { | 1187 res.get(arg_subscription).then(unittest.expectAsync1(((api.Subscription re
sponse) { |
| 1188 checkSubscription(response); | 1188 checkSubscription(response); |
| 1189 }))); | 1189 }))); |
| 1190 }); | 1190 }); |
| 1191 | 1191 |
| 1192 unittest.test("method--getIamPolicy", () { | 1192 unittest.test("method--getIamPolicy", () { |
| 1193 | 1193 |
| 1194 var mock = new HttpServerMock(); | 1194 var mock = new HttpServerMock(); |
| 1195 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1195 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1196 var arg_resource = "foo"; | 1196 var arg_resource = "foo"; |
| 1197 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1197 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1198 var path = (req.url).path; | 1198 var path = (req.url).path; |
| 1199 var pathOffset = 0; | 1199 var pathOffset = 0; |
| 1200 var index; | 1200 var index; |
| 1201 var subPart; | 1201 var subPart; |
| 1202 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1202 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1203 pathOffset += 1; | 1203 pathOffset += 1; |
| 1204 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1204 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1205 pathOffset += 3; | 1205 pathOffset += 3; |
| 1206 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1206 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1207 | 1207 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1222 } | 1222 } |
| 1223 } | 1223 } |
| 1224 | 1224 |
| 1225 | 1225 |
| 1226 var h = { | 1226 var h = { |
| 1227 "content-type" : "application/json; charset=utf-8", | 1227 "content-type" : "application/json; charset=utf-8", |
| 1228 }; | 1228 }; |
| 1229 var resp = convert.JSON.encode(buildPolicy()); | 1229 var resp = convert.JSON.encode(buildPolicy()); |
| 1230 return new async.Future.value(stringResponse(200, h, resp)); | 1230 return new async.Future.value(stringResponse(200, h, resp)); |
| 1231 }), true); | 1231 }), true); |
| 1232 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp
onse) { | 1232 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res
ponse) { |
| 1233 checkPolicy(response); | 1233 checkPolicy(response); |
| 1234 }))); | 1234 }))); |
| 1235 }); | 1235 }); |
| 1236 | 1236 |
| 1237 unittest.test("method--list", () { | 1237 unittest.test("method--list", () { |
| 1238 | 1238 |
| 1239 var mock = new HttpServerMock(); | 1239 var mock = new HttpServerMock(); |
| 1240 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1240 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1241 var arg_project = "foo"; | 1241 var arg_project = "foo"; |
| 1242 var arg_pageToken = "foo"; | 1242 var arg_pageToken = "foo"; |
| 1243 var arg_pageSize = 42; | 1243 var arg_pageSize = 42; |
| 1244 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1244 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1245 var path = (req.url).path; | 1245 var path = (req.url).path; |
| 1246 var pathOffset = 0; | 1246 var pathOffset = 0; |
| 1247 var index; | 1247 var index; |
| 1248 var subPart; | 1248 var subPart; |
| 1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1249 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1250 pathOffset += 1; | 1250 pathOffset += 1; |
| 1251 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1251 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1252 pathOffset += 3; | 1252 pathOffset += 3; |
| 1253 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1253 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1254 | 1254 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1271 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1271 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1272 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1272 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1273 | 1273 |
| 1274 | 1274 |
| 1275 var h = { | 1275 var h = { |
| 1276 "content-type" : "application/json; charset=utf-8", | 1276 "content-type" : "application/json; charset=utf-8", |
| 1277 }; | 1277 }; |
| 1278 var resp = convert.JSON.encode(buildListSubscriptionsResponse()); | 1278 var resp = convert.JSON.encode(buildListSubscriptionsResponse()); |
| 1279 return new async.Future.value(stringResponse(200, h, resp)); | 1279 return new async.Future.value(stringResponse(200, h, resp)); |
| 1280 }), true); | 1280 }), true); |
| 1281 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th
en(unittest.expectAsync(((api.ListSubscriptionsResponse response) { | 1281 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th
en(unittest.expectAsync1(((api.ListSubscriptionsResponse response) { |
| 1282 checkListSubscriptionsResponse(response); | 1282 checkListSubscriptionsResponse(response); |
| 1283 }))); | 1283 }))); |
| 1284 }); | 1284 }); |
| 1285 | 1285 |
| 1286 unittest.test("method--modifyAckDeadline", () { | 1286 unittest.test("method--modifyAckDeadline", () { |
| 1287 | 1287 |
| 1288 var mock = new HttpServerMock(); | 1288 var mock = new HttpServerMock(); |
| 1289 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1289 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1290 var arg_request = buildModifyAckDeadlineRequest(); | 1290 var arg_request = buildModifyAckDeadlineRequest(); |
| 1291 var arg_subscription = "foo"; | 1291 var arg_subscription = "foo"; |
| 1292 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1292 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1293 var obj = new api.ModifyAckDeadlineRequest.fromJson(json); | 1293 var obj = new api.ModifyAckDeadlineRequest.fromJson(json); |
| 1294 checkModifyAckDeadlineRequest(obj); | 1294 checkModifyAckDeadlineRequest(obj); |
| 1295 | 1295 |
| 1296 var path = (req.url).path; | 1296 var path = (req.url).path; |
| 1297 var pathOffset = 0; | 1297 var pathOffset = 0; |
| 1298 var index; | 1298 var index; |
| 1299 var subPart; | 1299 var subPart; |
| 1300 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1300 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1301 pathOffset += 1; | 1301 pathOffset += 1; |
| 1302 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1302 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1320 } | 1320 } |
| 1321 } | 1321 } |
| 1322 | 1322 |
| 1323 | 1323 |
| 1324 var h = { | 1324 var h = { |
| 1325 "content-type" : "application/json; charset=utf-8", | 1325 "content-type" : "application/json; charset=utf-8", |
| 1326 }; | 1326 }; |
| 1327 var resp = convert.JSON.encode(buildEmpty()); | 1327 var resp = convert.JSON.encode(buildEmpty()); |
| 1328 return new async.Future.value(stringResponse(200, h, resp)); | 1328 return new async.Future.value(stringResponse(200, h, resp)); |
| 1329 }), true); | 1329 }), true); |
| 1330 res.modifyAckDeadline(arg_request, arg_subscription).then(unittest.expectA
sync(((api.Empty response) { | 1330 res.modifyAckDeadline(arg_request, arg_subscription).then(unittest.expectA
sync1(((api.Empty response) { |
| 1331 checkEmpty(response); | 1331 checkEmpty(response); |
| 1332 }))); | 1332 }))); |
| 1333 }); | 1333 }); |
| 1334 | 1334 |
| 1335 unittest.test("method--modifyPushConfig", () { | 1335 unittest.test("method--modifyPushConfig", () { |
| 1336 | 1336 |
| 1337 var mock = new HttpServerMock(); | 1337 var mock = new HttpServerMock(); |
| 1338 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1338 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1339 var arg_request = buildModifyPushConfigRequest(); | 1339 var arg_request = buildModifyPushConfigRequest(); |
| 1340 var arg_subscription = "foo"; | 1340 var arg_subscription = "foo"; |
| 1341 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1341 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1342 var obj = new api.ModifyPushConfigRequest.fromJson(json); | 1342 var obj = new api.ModifyPushConfigRequest.fromJson(json); |
| 1343 checkModifyPushConfigRequest(obj); | 1343 checkModifyPushConfigRequest(obj); |
| 1344 | 1344 |
| 1345 var path = (req.url).path; | 1345 var path = (req.url).path; |
| 1346 var pathOffset = 0; | 1346 var pathOffset = 0; |
| 1347 var index; | 1347 var index; |
| 1348 var subPart; | 1348 var subPart; |
| 1349 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1349 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1350 pathOffset += 1; | 1350 pathOffset += 1; |
| 1351 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1351 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1369 } | 1369 } |
| 1370 } | 1370 } |
| 1371 | 1371 |
| 1372 | 1372 |
| 1373 var h = { | 1373 var h = { |
| 1374 "content-type" : "application/json; charset=utf-8", | 1374 "content-type" : "application/json; charset=utf-8", |
| 1375 }; | 1375 }; |
| 1376 var resp = convert.JSON.encode(buildEmpty()); | 1376 var resp = convert.JSON.encode(buildEmpty()); |
| 1377 return new async.Future.value(stringResponse(200, h, resp)); | 1377 return new async.Future.value(stringResponse(200, h, resp)); |
| 1378 }), true); | 1378 }), true); |
| 1379 res.modifyPushConfig(arg_request, arg_subscription).then(unittest.expectAs
ync(((api.Empty response) { | 1379 res.modifyPushConfig(arg_request, arg_subscription).then(unittest.expectAs
ync1(((api.Empty response) { |
| 1380 checkEmpty(response); | 1380 checkEmpty(response); |
| 1381 }))); | 1381 }))); |
| 1382 }); | 1382 }); |
| 1383 | 1383 |
| 1384 unittest.test("method--pull", () { | 1384 unittest.test("method--pull", () { |
| 1385 | 1385 |
| 1386 var mock = new HttpServerMock(); | 1386 var mock = new HttpServerMock(); |
| 1387 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1387 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1388 var arg_request = buildPullRequest(); | 1388 var arg_request = buildPullRequest(); |
| 1389 var arg_subscription = "foo"; | 1389 var arg_subscription = "foo"; |
| 1390 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1390 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1391 var obj = new api.PullRequest.fromJson(json); | 1391 var obj = new api.PullRequest.fromJson(json); |
| 1392 checkPullRequest(obj); | 1392 checkPullRequest(obj); |
| 1393 | 1393 |
| 1394 var path = (req.url).path; | 1394 var path = (req.url).path; |
| 1395 var pathOffset = 0; | 1395 var pathOffset = 0; |
| 1396 var index; | 1396 var index; |
| 1397 var subPart; | 1397 var subPart; |
| 1398 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1398 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1399 pathOffset += 1; | 1399 pathOffset += 1; |
| 1400 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1400 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1418 } | 1418 } |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 | 1421 |
| 1422 var h = { | 1422 var h = { |
| 1423 "content-type" : "application/json; charset=utf-8", | 1423 "content-type" : "application/json; charset=utf-8", |
| 1424 }; | 1424 }; |
| 1425 var resp = convert.JSON.encode(buildPullResponse()); | 1425 var resp = convert.JSON.encode(buildPullResponse()); |
| 1426 return new async.Future.value(stringResponse(200, h, resp)); | 1426 return new async.Future.value(stringResponse(200, h, resp)); |
| 1427 }), true); | 1427 }), true); |
| 1428 res.pull(arg_request, arg_subscription).then(unittest.expectAsync(((api.Pu
llResponse response) { | 1428 res.pull(arg_request, arg_subscription).then(unittest.expectAsync1(((api.P
ullResponse response) { |
| 1429 checkPullResponse(response); | 1429 checkPullResponse(response); |
| 1430 }))); | 1430 }))); |
| 1431 }); | 1431 }); |
| 1432 | 1432 |
| 1433 unittest.test("method--setIamPolicy", () { | 1433 unittest.test("method--setIamPolicy", () { |
| 1434 | 1434 |
| 1435 var mock = new HttpServerMock(); | 1435 var mock = new HttpServerMock(); |
| 1436 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1436 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1437 var arg_request = buildSetIamPolicyRequest(); | 1437 var arg_request = buildSetIamPolicyRequest(); |
| 1438 var arg_resource = "foo"; | 1438 var arg_resource = "foo"; |
| 1439 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1439 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1440 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1440 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 1441 checkSetIamPolicyRequest(obj); | 1441 checkSetIamPolicyRequest(obj); |
| 1442 | 1442 |
| 1443 var path = (req.url).path; | 1443 var path = (req.url).path; |
| 1444 var pathOffset = 0; | 1444 var pathOffset = 0; |
| 1445 var index; | 1445 var index; |
| 1446 var subPart; | 1446 var subPart; |
| 1447 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1447 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1448 pathOffset += 1; | 1448 pathOffset += 1; |
| 1449 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1449 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1467 } | 1467 } |
| 1468 } | 1468 } |
| 1469 | 1469 |
| 1470 | 1470 |
| 1471 var h = { | 1471 var h = { |
| 1472 "content-type" : "application/json; charset=utf-8", | 1472 "content-type" : "application/json; charset=utf-8", |
| 1473 }; | 1473 }; |
| 1474 var resp = convert.JSON.encode(buildPolicy()); | 1474 var resp = convert.JSON.encode(buildPolicy()); |
| 1475 return new async.Future.value(stringResponse(200, h, resp)); | 1475 return new async.Future.value(stringResponse(200, h, resp)); |
| 1476 }), true); | 1476 }), true); |
| 1477 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1477 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 1478 checkPolicy(response); | 1478 checkPolicy(response); |
| 1479 }))); | 1479 }))); |
| 1480 }); | 1480 }); |
| 1481 | 1481 |
| 1482 unittest.test("method--testIamPermissions", () { | 1482 unittest.test("method--testIamPermissions", () { |
| 1483 | 1483 |
| 1484 var mock = new HttpServerMock(); | 1484 var mock = new HttpServerMock(); |
| 1485 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; | 1485 api.ProjectsSubscriptionsResourceApi res = new api.PubsubApi(mock).project
s.subscriptions; |
| 1486 var arg_request = buildTestIamPermissionsRequest(); | 1486 var arg_request = buildTestIamPermissionsRequest(); |
| 1487 var arg_resource = "foo"; | 1487 var arg_resource = "foo"; |
| 1488 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1488 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1489 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1489 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1490 checkTestIamPermissionsRequest(obj); | 1490 checkTestIamPermissionsRequest(obj); |
| 1491 | 1491 |
| 1492 var path = (req.url).path; | 1492 var path = (req.url).path; |
| 1493 var pathOffset = 0; | 1493 var pathOffset = 0; |
| 1494 var index; | 1494 var index; |
| 1495 var subPart; | 1495 var subPart; |
| 1496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1496 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1497 pathOffset += 1; | 1497 pathOffset += 1; |
| 1498 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1498 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1516 } | 1516 } |
| 1517 } | 1517 } |
| 1518 | 1518 |
| 1519 | 1519 |
| 1520 var h = { | 1520 var h = { |
| 1521 "content-type" : "application/json; charset=utf-8", | 1521 "content-type" : "application/json; charset=utf-8", |
| 1522 }; | 1522 }; |
| 1523 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1523 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1524 return new async.Future.value(stringResponse(200, h, resp)); | 1524 return new async.Future.value(stringResponse(200, h, resp)); |
| 1525 }), true); | 1525 }), true); |
| 1526 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1526 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
| 1527 checkTestIamPermissionsResponse(response); | 1527 checkTestIamPermissionsResponse(response); |
| 1528 }))); | 1528 }))); |
| 1529 }); | 1529 }); |
| 1530 | 1530 |
| 1531 }); | 1531 }); |
| 1532 | 1532 |
| 1533 | 1533 |
| 1534 unittest.group("resource-ProjectsTopicsResourceApi", () { | 1534 unittest.group("resource-ProjectsTopicsResourceApi", () { |
| 1535 unittest.test("method--create", () { | 1535 unittest.test("method--create", () { |
| 1536 | 1536 |
| 1537 var mock = new HttpServerMock(); | 1537 var mock = new HttpServerMock(); |
| 1538 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1538 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1539 var arg_request = buildTopic(); | 1539 var arg_request = buildTopic(); |
| 1540 var arg_name = "foo"; | 1540 var arg_name = "foo"; |
| 1541 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1541 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1542 var obj = new api.Topic.fromJson(json); | 1542 var obj = new api.Topic.fromJson(json); |
| 1543 checkTopic(obj); | 1543 checkTopic(obj); |
| 1544 | 1544 |
| 1545 var path = (req.url).path; | 1545 var path = (req.url).path; |
| 1546 var pathOffset = 0; | 1546 var pathOffset = 0; |
| 1547 var index; | 1547 var index; |
| 1548 var subPart; | 1548 var subPart; |
| 1549 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1549 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1550 pathOffset += 1; | 1550 pathOffset += 1; |
| 1551 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1551 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1569 } | 1569 } |
| 1570 } | 1570 } |
| 1571 | 1571 |
| 1572 | 1572 |
| 1573 var h = { | 1573 var h = { |
| 1574 "content-type" : "application/json; charset=utf-8", | 1574 "content-type" : "application/json; charset=utf-8", |
| 1575 }; | 1575 }; |
| 1576 var resp = convert.JSON.encode(buildTopic()); | 1576 var resp = convert.JSON.encode(buildTopic()); |
| 1577 return new async.Future.value(stringResponse(200, h, resp)); | 1577 return new async.Future.value(stringResponse(200, h, resp)); |
| 1578 }), true); | 1578 }), true); |
| 1579 res.create(arg_request, arg_name).then(unittest.expectAsync(((api.Topic re
sponse) { | 1579 res.create(arg_request, arg_name).then(unittest.expectAsync1(((api.Topic r
esponse) { |
| 1580 checkTopic(response); | 1580 checkTopic(response); |
| 1581 }))); | 1581 }))); |
| 1582 }); | 1582 }); |
| 1583 | 1583 |
| 1584 unittest.test("method--delete", () { | 1584 unittest.test("method--delete", () { |
| 1585 | 1585 |
| 1586 var mock = new HttpServerMock(); | 1586 var mock = new HttpServerMock(); |
| 1587 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1587 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1588 var arg_topic = "foo"; | 1588 var arg_topic = "foo"; |
| 1589 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1589 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1590 var path = (req.url).path; | 1590 var path = (req.url).path; |
| 1591 var pathOffset = 0; | 1591 var pathOffset = 0; |
| 1592 var index; | 1592 var index; |
| 1593 var subPart; | 1593 var subPart; |
| 1594 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1594 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1595 pathOffset += 1; | 1595 pathOffset += 1; |
| 1596 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1596 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1597 pathOffset += 3; | 1597 pathOffset += 3; |
| 1598 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1598 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1599 | 1599 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1614 } | 1614 } |
| 1615 } | 1615 } |
| 1616 | 1616 |
| 1617 | 1617 |
| 1618 var h = { | 1618 var h = { |
| 1619 "content-type" : "application/json; charset=utf-8", | 1619 "content-type" : "application/json; charset=utf-8", |
| 1620 }; | 1620 }; |
| 1621 var resp = convert.JSON.encode(buildEmpty()); | 1621 var resp = convert.JSON.encode(buildEmpty()); |
| 1622 return new async.Future.value(stringResponse(200, h, resp)); | 1622 return new async.Future.value(stringResponse(200, h, resp)); |
| 1623 }), true); | 1623 }), true); |
| 1624 res.delete(arg_topic).then(unittest.expectAsync(((api.Empty response) { | 1624 res.delete(arg_topic).then(unittest.expectAsync1(((api.Empty response) { |
| 1625 checkEmpty(response); | 1625 checkEmpty(response); |
| 1626 }))); | 1626 }))); |
| 1627 }); | 1627 }); |
| 1628 | 1628 |
| 1629 unittest.test("method--get", () { | 1629 unittest.test("method--get", () { |
| 1630 | 1630 |
| 1631 var mock = new HttpServerMock(); | 1631 var mock = new HttpServerMock(); |
| 1632 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1632 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1633 var arg_topic = "foo"; | 1633 var arg_topic = "foo"; |
| 1634 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1634 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1635 var path = (req.url).path; | 1635 var path = (req.url).path; |
| 1636 var pathOffset = 0; | 1636 var pathOffset = 0; |
| 1637 var index; | 1637 var index; |
| 1638 var subPart; | 1638 var subPart; |
| 1639 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1639 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1640 pathOffset += 1; | 1640 pathOffset += 1; |
| 1641 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1641 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1642 pathOffset += 3; | 1642 pathOffset += 3; |
| 1643 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1643 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1644 | 1644 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1659 } | 1659 } |
| 1660 } | 1660 } |
| 1661 | 1661 |
| 1662 | 1662 |
| 1663 var h = { | 1663 var h = { |
| 1664 "content-type" : "application/json; charset=utf-8", | 1664 "content-type" : "application/json; charset=utf-8", |
| 1665 }; | 1665 }; |
| 1666 var resp = convert.JSON.encode(buildTopic()); | 1666 var resp = convert.JSON.encode(buildTopic()); |
| 1667 return new async.Future.value(stringResponse(200, h, resp)); | 1667 return new async.Future.value(stringResponse(200, h, resp)); |
| 1668 }), true); | 1668 }), true); |
| 1669 res.get(arg_topic).then(unittest.expectAsync(((api.Topic response) { | 1669 res.get(arg_topic).then(unittest.expectAsync1(((api.Topic response) { |
| 1670 checkTopic(response); | 1670 checkTopic(response); |
| 1671 }))); | 1671 }))); |
| 1672 }); | 1672 }); |
| 1673 | 1673 |
| 1674 unittest.test("method--getIamPolicy", () { | 1674 unittest.test("method--getIamPolicy", () { |
| 1675 | 1675 |
| 1676 var mock = new HttpServerMock(); | 1676 var mock = new HttpServerMock(); |
| 1677 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1677 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1678 var arg_resource = "foo"; | 1678 var arg_resource = "foo"; |
| 1679 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1679 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1680 var path = (req.url).path; | 1680 var path = (req.url).path; |
| 1681 var pathOffset = 0; | 1681 var pathOffset = 0; |
| 1682 var index; | 1682 var index; |
| 1683 var subPart; | 1683 var subPart; |
| 1684 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1684 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1685 pathOffset += 1; | 1685 pathOffset += 1; |
| 1686 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1686 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1687 pathOffset += 3; | 1687 pathOffset += 3; |
| 1688 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1688 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1689 | 1689 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1704 } | 1704 } |
| 1705 } | 1705 } |
| 1706 | 1706 |
| 1707 | 1707 |
| 1708 var h = { | 1708 var h = { |
| 1709 "content-type" : "application/json; charset=utf-8", | 1709 "content-type" : "application/json; charset=utf-8", |
| 1710 }; | 1710 }; |
| 1711 var resp = convert.JSON.encode(buildPolicy()); | 1711 var resp = convert.JSON.encode(buildPolicy()); |
| 1712 return new async.Future.value(stringResponse(200, h, resp)); | 1712 return new async.Future.value(stringResponse(200, h, resp)); |
| 1713 }), true); | 1713 }), true); |
| 1714 res.getIamPolicy(arg_resource).then(unittest.expectAsync(((api.Policy resp
onse) { | 1714 res.getIamPolicy(arg_resource).then(unittest.expectAsync1(((api.Policy res
ponse) { |
| 1715 checkPolicy(response); | 1715 checkPolicy(response); |
| 1716 }))); | 1716 }))); |
| 1717 }); | 1717 }); |
| 1718 | 1718 |
| 1719 unittest.test("method--list", () { | 1719 unittest.test("method--list", () { |
| 1720 | 1720 |
| 1721 var mock = new HttpServerMock(); | 1721 var mock = new HttpServerMock(); |
| 1722 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1722 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1723 var arg_project = "foo"; | 1723 var arg_project = "foo"; |
| 1724 var arg_pageToken = "foo"; | 1724 var arg_pageToken = "foo"; |
| 1725 var arg_pageSize = 42; | 1725 var arg_pageSize = 42; |
| 1726 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1726 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1727 var path = (req.url).path; | 1727 var path = (req.url).path; |
| 1728 var pathOffset = 0; | 1728 var pathOffset = 0; |
| 1729 var index; | 1729 var index; |
| 1730 var subPart; | 1730 var subPart; |
| 1731 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1731 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1732 pathOffset += 1; | 1732 pathOffset += 1; |
| 1733 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1733 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1734 pathOffset += 3; | 1734 pathOffset += 3; |
| 1735 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1735 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1736 | 1736 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1753 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1753 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1754 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1754 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1755 | 1755 |
| 1756 | 1756 |
| 1757 var h = { | 1757 var h = { |
| 1758 "content-type" : "application/json; charset=utf-8", | 1758 "content-type" : "application/json; charset=utf-8", |
| 1759 }; | 1759 }; |
| 1760 var resp = convert.JSON.encode(buildListTopicsResponse()); | 1760 var resp = convert.JSON.encode(buildListTopicsResponse()); |
| 1761 return new async.Future.value(stringResponse(200, h, resp)); | 1761 return new async.Future.value(stringResponse(200, h, resp)); |
| 1762 }), true); | 1762 }), true); |
| 1763 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th
en(unittest.expectAsync(((api.ListTopicsResponse response) { | 1763 res.list(arg_project, pageToken: arg_pageToken, pageSize: arg_pageSize).th
en(unittest.expectAsync1(((api.ListTopicsResponse response) { |
| 1764 checkListTopicsResponse(response); | 1764 checkListTopicsResponse(response); |
| 1765 }))); | 1765 }))); |
| 1766 }); | 1766 }); |
| 1767 | 1767 |
| 1768 unittest.test("method--publish", () { | 1768 unittest.test("method--publish", () { |
| 1769 | 1769 |
| 1770 var mock = new HttpServerMock(); | 1770 var mock = new HttpServerMock(); |
| 1771 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1771 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1772 var arg_request = buildPublishRequest(); | 1772 var arg_request = buildPublishRequest(); |
| 1773 var arg_topic = "foo"; | 1773 var arg_topic = "foo"; |
| 1774 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1774 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1775 var obj = new api.PublishRequest.fromJson(json); | 1775 var obj = new api.PublishRequest.fromJson(json); |
| 1776 checkPublishRequest(obj); | 1776 checkPublishRequest(obj); |
| 1777 | 1777 |
| 1778 var path = (req.url).path; | 1778 var path = (req.url).path; |
| 1779 var pathOffset = 0; | 1779 var pathOffset = 0; |
| 1780 var index; | 1780 var index; |
| 1781 var subPart; | 1781 var subPart; |
| 1782 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1782 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1783 pathOffset += 1; | 1783 pathOffset += 1; |
| 1784 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1784 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1802 } | 1802 } |
| 1803 } | 1803 } |
| 1804 | 1804 |
| 1805 | 1805 |
| 1806 var h = { | 1806 var h = { |
| 1807 "content-type" : "application/json; charset=utf-8", | 1807 "content-type" : "application/json; charset=utf-8", |
| 1808 }; | 1808 }; |
| 1809 var resp = convert.JSON.encode(buildPublishResponse()); | 1809 var resp = convert.JSON.encode(buildPublishResponse()); |
| 1810 return new async.Future.value(stringResponse(200, h, resp)); | 1810 return new async.Future.value(stringResponse(200, h, resp)); |
| 1811 }), true); | 1811 }), true); |
| 1812 res.publish(arg_request, arg_topic).then(unittest.expectAsync(((api.Publis
hResponse response) { | 1812 res.publish(arg_request, arg_topic).then(unittest.expectAsync1(((api.Publi
shResponse response) { |
| 1813 checkPublishResponse(response); | 1813 checkPublishResponse(response); |
| 1814 }))); | 1814 }))); |
| 1815 }); | 1815 }); |
| 1816 | 1816 |
| 1817 unittest.test("method--setIamPolicy", () { | 1817 unittest.test("method--setIamPolicy", () { |
| 1818 | 1818 |
| 1819 var mock = new HttpServerMock(); | 1819 var mock = new HttpServerMock(); |
| 1820 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1820 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1821 var arg_request = buildSetIamPolicyRequest(); | 1821 var arg_request = buildSetIamPolicyRequest(); |
| 1822 var arg_resource = "foo"; | 1822 var arg_resource = "foo"; |
| 1823 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1823 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1824 var obj = new api.SetIamPolicyRequest.fromJson(json); | 1824 var obj = new api.SetIamPolicyRequest.fromJson(json); |
| 1825 checkSetIamPolicyRequest(obj); | 1825 checkSetIamPolicyRequest(obj); |
| 1826 | 1826 |
| 1827 var path = (req.url).path; | 1827 var path = (req.url).path; |
| 1828 var pathOffset = 0; | 1828 var pathOffset = 0; |
| 1829 var index; | 1829 var index; |
| 1830 var subPart; | 1830 var subPart; |
| 1831 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1831 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1832 pathOffset += 1; | 1832 pathOffset += 1; |
| 1833 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1833 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1851 } | 1851 } |
| 1852 } | 1852 } |
| 1853 | 1853 |
| 1854 | 1854 |
| 1855 var h = { | 1855 var h = { |
| 1856 "content-type" : "application/json; charset=utf-8", | 1856 "content-type" : "application/json; charset=utf-8", |
| 1857 }; | 1857 }; |
| 1858 var resp = convert.JSON.encode(buildPolicy()); | 1858 var resp = convert.JSON.encode(buildPolicy()); |
| 1859 return new async.Future.value(stringResponse(200, h, resp)); | 1859 return new async.Future.value(stringResponse(200, h, resp)); |
| 1860 }), true); | 1860 }), true); |
| 1861 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync(((ap
i.Policy response) { | 1861 res.setIamPolicy(arg_request, arg_resource).then(unittest.expectAsync1(((a
pi.Policy response) { |
| 1862 checkPolicy(response); | 1862 checkPolicy(response); |
| 1863 }))); | 1863 }))); |
| 1864 }); | 1864 }); |
| 1865 | 1865 |
| 1866 unittest.test("method--testIamPermissions", () { | 1866 unittest.test("method--testIamPermissions", () { |
| 1867 | 1867 |
| 1868 var mock = new HttpServerMock(); | 1868 var mock = new HttpServerMock(); |
| 1869 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; | 1869 api.ProjectsTopicsResourceApi res = new api.PubsubApi(mock).projects.topic
s; |
| 1870 var arg_request = buildTestIamPermissionsRequest(); | 1870 var arg_request = buildTestIamPermissionsRequest(); |
| 1871 var arg_resource = "foo"; | 1871 var arg_resource = "foo"; |
| 1872 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1872 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1873 var obj = new api.TestIamPermissionsRequest.fromJson(json); | 1873 var obj = new api.TestIamPermissionsRequest.fromJson(json); |
| 1874 checkTestIamPermissionsRequest(obj); | 1874 checkTestIamPermissionsRequest(obj); |
| 1875 | 1875 |
| 1876 var path = (req.url).path; | 1876 var path = (req.url).path; |
| 1877 var pathOffset = 0; | 1877 var pathOffset = 0; |
| 1878 var index; | 1878 var index; |
| 1879 var subPart; | 1879 var subPart; |
| 1880 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1880 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1881 pathOffset += 1; | 1881 pathOffset += 1; |
| 1882 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1882 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1900 } | 1900 } |
| 1901 } | 1901 } |
| 1902 | 1902 |
| 1903 | 1903 |
| 1904 var h = { | 1904 var h = { |
| 1905 "content-type" : "application/json; charset=utf-8", | 1905 "content-type" : "application/json; charset=utf-8", |
| 1906 }; | 1906 }; |
| 1907 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); | 1907 var resp = convert.JSON.encode(buildTestIamPermissionsResponse()); |
| 1908 return new async.Future.value(stringResponse(200, h, resp)); | 1908 return new async.Future.value(stringResponse(200, h, resp)); |
| 1909 }), true); | 1909 }), true); |
| 1910 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c(((api.TestIamPermissionsResponse response) { | 1910 res.testIamPermissions(arg_request, arg_resource).then(unittest.expectAsyn
c1(((api.TestIamPermissionsResponse response) { |
| 1911 checkTestIamPermissionsResponse(response); | 1911 checkTestIamPermissionsResponse(response); |
| 1912 }))); | 1912 }))); |
| 1913 }); | 1913 }); |
| 1914 | 1914 |
| 1915 }); | 1915 }); |
| 1916 | 1916 |
| 1917 | 1917 |
| 1918 unittest.group("resource-ProjectsTopicsSubscriptionsResourceApi", () { | 1918 unittest.group("resource-ProjectsTopicsSubscriptionsResourceApi", () { |
| 1919 unittest.test("method--list", () { | 1919 unittest.test("method--list", () { |
| 1920 | 1920 |
| 1921 var mock = new HttpServerMock(); | 1921 var mock = new HttpServerMock(); |
| 1922 api.ProjectsTopicsSubscriptionsResourceApi res = new api.PubsubApi(mock).p
rojects.topics.subscriptions; | 1922 api.ProjectsTopicsSubscriptionsResourceApi res = new api.PubsubApi(mock).p
rojects.topics.subscriptions; |
| 1923 var arg_topic = "foo"; | 1923 var arg_topic = "foo"; |
| 1924 var arg_pageToken = "foo"; | 1924 var arg_pageToken = "foo"; |
| 1925 var arg_pageSize = 42; | 1925 var arg_pageSize = 42; |
| 1926 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1926 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1927 var path = (req.url).path; | 1927 var path = (req.url).path; |
| 1928 var pathOffset = 0; | 1928 var pathOffset = 0; |
| 1929 var index; | 1929 var index; |
| 1930 var subPart; | 1930 var subPart; |
| 1931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1931 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1932 pathOffset += 1; | 1932 pathOffset += 1; |
| 1933 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); | 1933 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 1934 pathOffset += 3; | 1934 pathOffset += 3; |
| 1935 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; | 1935 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 1936 | 1936 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1953 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1953 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1954 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 1954 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1955 | 1955 |
| 1956 | 1956 |
| 1957 var h = { | 1957 var h = { |
| 1958 "content-type" : "application/json; charset=utf-8", | 1958 "content-type" : "application/json; charset=utf-8", |
| 1959 }; | 1959 }; |
| 1960 var resp = convert.JSON.encode(buildListTopicSubscriptionsResponse()); | 1960 var resp = convert.JSON.encode(buildListTopicSubscriptionsResponse()); |
| 1961 return new async.Future.value(stringResponse(200, h, resp)); | 1961 return new async.Future.value(stringResponse(200, h, resp)); |
| 1962 }), true); | 1962 }), true); |
| 1963 res.list(arg_topic, pageToken: arg_pageToken, pageSize: arg_pageSize).then
(unittest.expectAsync(((api.ListTopicSubscriptionsResponse response) { | 1963 res.list(arg_topic, pageToken: arg_pageToken, pageSize: arg_pageSize).then
(unittest.expectAsync1(((api.ListTopicSubscriptionsResponse response) { |
| 1964 checkListTopicSubscriptionsResponse(response); | 1964 checkListTopicSubscriptionsResponse(response); |
| 1965 }))); | 1965 }))); |
| 1966 }); | 1966 }); |
| 1967 | 1967 |
| 1968 }); | 1968 }); |
| 1969 | 1969 |
| 1970 | 1970 |
| 1971 } | 1971 } |
| 1972 | 1972 |
| OLD | NEW |