| OLD | NEW |
| 1 library googleapis.prediction.v1_6.test; | 1 library googleapis.prediction.v1_6.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | |
| 5 import "dart:async" as async; | 4 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 5 import "dart:convert" as convert; |
| 7 | 6 |
| 8 import 'package:http/http.dart' as http; | 7 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | |
| 10 import 'package:test/test.dart' as unittest; | 8 import 'package:test/test.dart' as unittest; |
| 11 | 9 |
| 12 import 'package:googleapis/prediction/v1_6.dart' as api; | 10 import 'package:googleapis/prediction/v1_6.dart' as api; |
| 13 | 11 |
| 14 class HttpServerMock extends http.BaseClient { | 12 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; | 13 core.Function _callback; |
| 16 core.bool _expectJson; | 14 core.bool _expectJson; |
| 17 | 15 |
| 18 void register(core.Function callback, core.bool expectJson) { | 16 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; | 17 _callback = callback; |
| 20 _expectJson = expectJson; | 18 _expectJson = expectJson; |
| 21 } | 19 } |
| 22 | 20 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { | 21 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { | 22 if (_expectJson) { |
| 25 return request.finalize() | 23 return request |
| 24 .finalize() |
| 26 .transform(convert.UTF8.decoder) | 25 .transform(convert.UTF8.decoder) |
| 27 .join('') | 26 .join('') |
| 28 .then((core.String jsonString) { | 27 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { | 28 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); | 29 return _callback(request, null); |
| 31 } else { | 30 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); | 31 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } | 32 } |
| 34 }); | 33 }); |
| 35 } else { | 34 } else { |
| 36 var stream = request.finalize(); | 35 var stream = request.finalize(); |
| 37 if (stream == null) { | 36 if (stream == null) { |
| 38 return _callback(request, []); | 37 return _callback(request, []); |
| 39 } else { | 38 } else { |
| 40 return stream.toBytes().then((data) { | 39 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); | 40 return _callback(request, data); |
| 42 }); | 41 }); |
| 43 } | 42 } |
| 44 } | 43 } |
| 45 } | 44 } |
| 46 } | 45 } |
| 47 | 46 |
| 48 http.StreamedResponse stringResponse( | 47 http.StreamedResponse stringResponse(core.int status, |
| 49 core.int status, core.Map<core.String, core.String> headers, core.String bod
y) { | 48 core.Map<core.String, core.String> headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 49 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 50 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 51 } |
| 53 | 52 |
| 54 core.int buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues = 0; | 53 core.int buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues = 0; |
| 55 buildAnalyzeDataDescriptionFeaturesCategoricalValues() { | 54 buildAnalyzeDataDescriptionFeaturesCategoricalValues() { |
| 56 var o = new api.AnalyzeDataDescriptionFeaturesCategoricalValues(); | 55 var o = new api.AnalyzeDataDescriptionFeaturesCategoricalValues(); |
| 57 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues++; | 56 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues++; |
| 58 if (buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues < 3) { | 57 if (buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues < 3) { |
| 59 o.count = "foo"; | 58 o.count = "foo"; |
| 60 o.value = "foo"; | 59 o.value = "foo"; |
| 61 } | 60 } |
| 62 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues--; | 61 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues--; |
| 63 return o; | 62 return o; |
| 64 } | 63 } |
| 65 | 64 |
| 66 checkAnalyzeDataDescriptionFeaturesCategoricalValues(api.AnalyzeDataDescriptionF
eaturesCategoricalValues o) { | 65 checkAnalyzeDataDescriptionFeaturesCategoricalValues( |
| 66 api.AnalyzeDataDescriptionFeaturesCategoricalValues o) { |
| 67 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues++; | 67 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues++; |
| 68 if (buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues < 3) { | 68 if (buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues < 3) { |
| 69 unittest.expect(o.count, unittest.equals('foo')); | 69 unittest.expect(o.count, unittest.equals('foo')); |
| 70 unittest.expect(o.value, unittest.equals('foo')); | 70 unittest.expect(o.value, unittest.equals('foo')); |
| 71 } | 71 } |
| 72 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues--; | 72 buildCounterAnalyzeDataDescriptionFeaturesCategoricalValues--; |
| 73 } | 73 } |
| 74 | 74 |
| 75 buildUnnamed1886() { | 75 buildUnnamed1884() { |
| 76 var o = new core.List<api.AnalyzeDataDescriptionFeaturesCategoricalValues>(); | 76 var o = new core.List<api.AnalyzeDataDescriptionFeaturesCategoricalValues>(); |
| 77 o.add(buildAnalyzeDataDescriptionFeaturesCategoricalValues()); | 77 o.add(buildAnalyzeDataDescriptionFeaturesCategoricalValues()); |
| 78 o.add(buildAnalyzeDataDescriptionFeaturesCategoricalValues()); | 78 o.add(buildAnalyzeDataDescriptionFeaturesCategoricalValues()); |
| 79 return o; | 79 return o; |
| 80 } | 80 } |
| 81 | 81 |
| 82 checkUnnamed1886(core.List<api.AnalyzeDataDescriptionFeaturesCategoricalValues>
o) { | 82 checkUnnamed1884( |
| 83 core.List<api.AnalyzeDataDescriptionFeaturesCategoricalValues> o) { |
| 83 unittest.expect(o, unittest.hasLength(2)); | 84 unittest.expect(o, unittest.hasLength(2)); |
| 84 checkAnalyzeDataDescriptionFeaturesCategoricalValues(o[0]); | 85 checkAnalyzeDataDescriptionFeaturesCategoricalValues(o[0]); |
| 85 checkAnalyzeDataDescriptionFeaturesCategoricalValues(o[1]); | 86 checkAnalyzeDataDescriptionFeaturesCategoricalValues(o[1]); |
| 86 } | 87 } |
| 87 | 88 |
| 88 core.int buildCounterAnalyzeDataDescriptionFeaturesCategorical = 0; | 89 core.int buildCounterAnalyzeDataDescriptionFeaturesCategorical = 0; |
| 89 buildAnalyzeDataDescriptionFeaturesCategorical() { | 90 buildAnalyzeDataDescriptionFeaturesCategorical() { |
| 90 var o = new api.AnalyzeDataDescriptionFeaturesCategorical(); | 91 var o = new api.AnalyzeDataDescriptionFeaturesCategorical(); |
| 91 buildCounterAnalyzeDataDescriptionFeaturesCategorical++; | 92 buildCounterAnalyzeDataDescriptionFeaturesCategorical++; |
| 92 if (buildCounterAnalyzeDataDescriptionFeaturesCategorical < 3) { | 93 if (buildCounterAnalyzeDataDescriptionFeaturesCategorical < 3) { |
| 93 o.count = "foo"; | 94 o.count = "foo"; |
| 94 o.values = buildUnnamed1886(); | 95 o.values = buildUnnamed1884(); |
| 95 } | 96 } |
| 96 buildCounterAnalyzeDataDescriptionFeaturesCategorical--; | 97 buildCounterAnalyzeDataDescriptionFeaturesCategorical--; |
| 97 return o; | 98 return o; |
| 98 } | 99 } |
| 99 | 100 |
| 100 checkAnalyzeDataDescriptionFeaturesCategorical(api.AnalyzeDataDescriptionFeature
sCategorical o) { | 101 checkAnalyzeDataDescriptionFeaturesCategorical( |
| 102 api.AnalyzeDataDescriptionFeaturesCategorical o) { |
| 101 buildCounterAnalyzeDataDescriptionFeaturesCategorical++; | 103 buildCounterAnalyzeDataDescriptionFeaturesCategorical++; |
| 102 if (buildCounterAnalyzeDataDescriptionFeaturesCategorical < 3) { | 104 if (buildCounterAnalyzeDataDescriptionFeaturesCategorical < 3) { |
| 103 unittest.expect(o.count, unittest.equals('foo')); | 105 unittest.expect(o.count, unittest.equals('foo')); |
| 104 checkUnnamed1886(o.values); | 106 checkUnnamed1884(o.values); |
| 105 } | 107 } |
| 106 buildCounterAnalyzeDataDescriptionFeaturesCategorical--; | 108 buildCounterAnalyzeDataDescriptionFeaturesCategorical--; |
| 107 } | 109 } |
| 108 | 110 |
| 109 core.int buildCounterAnalyzeDataDescriptionFeaturesNumeric = 0; | 111 core.int buildCounterAnalyzeDataDescriptionFeaturesNumeric = 0; |
| 110 buildAnalyzeDataDescriptionFeaturesNumeric() { | 112 buildAnalyzeDataDescriptionFeaturesNumeric() { |
| 111 var o = new api.AnalyzeDataDescriptionFeaturesNumeric(); | 113 var o = new api.AnalyzeDataDescriptionFeaturesNumeric(); |
| 112 buildCounterAnalyzeDataDescriptionFeaturesNumeric++; | 114 buildCounterAnalyzeDataDescriptionFeaturesNumeric++; |
| 113 if (buildCounterAnalyzeDataDescriptionFeaturesNumeric < 3) { | 115 if (buildCounterAnalyzeDataDescriptionFeaturesNumeric < 3) { |
| 114 o.count = "foo"; | 116 o.count = "foo"; |
| 115 o.mean = "foo"; | 117 o.mean = "foo"; |
| 116 o.variance = "foo"; | 118 o.variance = "foo"; |
| 117 } | 119 } |
| 118 buildCounterAnalyzeDataDescriptionFeaturesNumeric--; | 120 buildCounterAnalyzeDataDescriptionFeaturesNumeric--; |
| 119 return o; | 121 return o; |
| 120 } | 122 } |
| 121 | 123 |
| 122 checkAnalyzeDataDescriptionFeaturesNumeric(api.AnalyzeDataDescriptionFeaturesNum
eric o) { | 124 checkAnalyzeDataDescriptionFeaturesNumeric( |
| 125 api.AnalyzeDataDescriptionFeaturesNumeric o) { |
| 123 buildCounterAnalyzeDataDescriptionFeaturesNumeric++; | 126 buildCounterAnalyzeDataDescriptionFeaturesNumeric++; |
| 124 if (buildCounterAnalyzeDataDescriptionFeaturesNumeric < 3) { | 127 if (buildCounterAnalyzeDataDescriptionFeaturesNumeric < 3) { |
| 125 unittest.expect(o.count, unittest.equals('foo')); | 128 unittest.expect(o.count, unittest.equals('foo')); |
| 126 unittest.expect(o.mean, unittest.equals('foo')); | 129 unittest.expect(o.mean, unittest.equals('foo')); |
| 127 unittest.expect(o.variance, unittest.equals('foo')); | 130 unittest.expect(o.variance, unittest.equals('foo')); |
| 128 } | 131 } |
| 129 buildCounterAnalyzeDataDescriptionFeaturesNumeric--; | 132 buildCounterAnalyzeDataDescriptionFeaturesNumeric--; |
| 130 } | 133 } |
| 131 | 134 |
| 132 core.int buildCounterAnalyzeDataDescriptionFeaturesText = 0; | 135 core.int buildCounterAnalyzeDataDescriptionFeaturesText = 0; |
| 133 buildAnalyzeDataDescriptionFeaturesText() { | 136 buildAnalyzeDataDescriptionFeaturesText() { |
| 134 var o = new api.AnalyzeDataDescriptionFeaturesText(); | 137 var o = new api.AnalyzeDataDescriptionFeaturesText(); |
| 135 buildCounterAnalyzeDataDescriptionFeaturesText++; | 138 buildCounterAnalyzeDataDescriptionFeaturesText++; |
| 136 if (buildCounterAnalyzeDataDescriptionFeaturesText < 3) { | 139 if (buildCounterAnalyzeDataDescriptionFeaturesText < 3) { |
| 137 o.count = "foo"; | 140 o.count = "foo"; |
| 138 } | 141 } |
| 139 buildCounterAnalyzeDataDescriptionFeaturesText--; | 142 buildCounterAnalyzeDataDescriptionFeaturesText--; |
| 140 return o; | 143 return o; |
| 141 } | 144 } |
| 142 | 145 |
| 143 checkAnalyzeDataDescriptionFeaturesText(api.AnalyzeDataDescriptionFeaturesText o
) { | 146 checkAnalyzeDataDescriptionFeaturesText( |
| 147 api.AnalyzeDataDescriptionFeaturesText o) { |
| 144 buildCounterAnalyzeDataDescriptionFeaturesText++; | 148 buildCounterAnalyzeDataDescriptionFeaturesText++; |
| 145 if (buildCounterAnalyzeDataDescriptionFeaturesText < 3) { | 149 if (buildCounterAnalyzeDataDescriptionFeaturesText < 3) { |
| 146 unittest.expect(o.count, unittest.equals('foo')); | 150 unittest.expect(o.count, unittest.equals('foo')); |
| 147 } | 151 } |
| 148 buildCounterAnalyzeDataDescriptionFeaturesText--; | 152 buildCounterAnalyzeDataDescriptionFeaturesText--; |
| 149 } | 153 } |
| 150 | 154 |
| 151 core.int buildCounterAnalyzeDataDescriptionFeatures = 0; | 155 core.int buildCounterAnalyzeDataDescriptionFeatures = 0; |
| 152 buildAnalyzeDataDescriptionFeatures() { | 156 buildAnalyzeDataDescriptionFeatures() { |
| 153 var o = new api.AnalyzeDataDescriptionFeatures(); | 157 var o = new api.AnalyzeDataDescriptionFeatures(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 166 buildCounterAnalyzeDataDescriptionFeatures++; | 170 buildCounterAnalyzeDataDescriptionFeatures++; |
| 167 if (buildCounterAnalyzeDataDescriptionFeatures < 3) { | 171 if (buildCounterAnalyzeDataDescriptionFeatures < 3) { |
| 168 checkAnalyzeDataDescriptionFeaturesCategorical(o.categorical); | 172 checkAnalyzeDataDescriptionFeaturesCategorical(o.categorical); |
| 169 unittest.expect(o.index, unittest.equals('foo')); | 173 unittest.expect(o.index, unittest.equals('foo')); |
| 170 checkAnalyzeDataDescriptionFeaturesNumeric(o.numeric); | 174 checkAnalyzeDataDescriptionFeaturesNumeric(o.numeric); |
| 171 checkAnalyzeDataDescriptionFeaturesText(o.text); | 175 checkAnalyzeDataDescriptionFeaturesText(o.text); |
| 172 } | 176 } |
| 173 buildCounterAnalyzeDataDescriptionFeatures--; | 177 buildCounterAnalyzeDataDescriptionFeatures--; |
| 174 } | 178 } |
| 175 | 179 |
| 176 buildUnnamed1887() { | 180 buildUnnamed1885() { |
| 177 var o = new core.List<api.AnalyzeDataDescriptionFeatures>(); | 181 var o = new core.List<api.AnalyzeDataDescriptionFeatures>(); |
| 178 o.add(buildAnalyzeDataDescriptionFeatures()); | 182 o.add(buildAnalyzeDataDescriptionFeatures()); |
| 179 o.add(buildAnalyzeDataDescriptionFeatures()); | 183 o.add(buildAnalyzeDataDescriptionFeatures()); |
| 180 return o; | 184 return o; |
| 181 } | 185 } |
| 182 | 186 |
| 183 checkUnnamed1887(core.List<api.AnalyzeDataDescriptionFeatures> o) { | 187 checkUnnamed1885(core.List<api.AnalyzeDataDescriptionFeatures> o) { |
| 184 unittest.expect(o, unittest.hasLength(2)); | 188 unittest.expect(o, unittest.hasLength(2)); |
| 185 checkAnalyzeDataDescriptionFeatures(o[0]); | 189 checkAnalyzeDataDescriptionFeatures(o[0]); |
| 186 checkAnalyzeDataDescriptionFeatures(o[1]); | 190 checkAnalyzeDataDescriptionFeatures(o[1]); |
| 187 } | 191 } |
| 188 | 192 |
| 189 core.int buildCounterAnalyzeDataDescriptionOutputFeatureNumeric = 0; | 193 core.int buildCounterAnalyzeDataDescriptionOutputFeatureNumeric = 0; |
| 190 buildAnalyzeDataDescriptionOutputFeatureNumeric() { | 194 buildAnalyzeDataDescriptionOutputFeatureNumeric() { |
| 191 var o = new api.AnalyzeDataDescriptionOutputFeatureNumeric(); | 195 var o = new api.AnalyzeDataDescriptionOutputFeatureNumeric(); |
| 192 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric++; | 196 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric++; |
| 193 if (buildCounterAnalyzeDataDescriptionOutputFeatureNumeric < 3) { | 197 if (buildCounterAnalyzeDataDescriptionOutputFeatureNumeric < 3) { |
| 194 o.count = "foo"; | 198 o.count = "foo"; |
| 195 o.mean = "foo"; | 199 o.mean = "foo"; |
| 196 o.variance = "foo"; | 200 o.variance = "foo"; |
| 197 } | 201 } |
| 198 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric--; | 202 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric--; |
| 199 return o; | 203 return o; |
| 200 } | 204 } |
| 201 | 205 |
| 202 checkAnalyzeDataDescriptionOutputFeatureNumeric(api.AnalyzeDataDescriptionOutput
FeatureNumeric o) { | 206 checkAnalyzeDataDescriptionOutputFeatureNumeric( |
| 207 api.AnalyzeDataDescriptionOutputFeatureNumeric o) { |
| 203 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric++; | 208 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric++; |
| 204 if (buildCounterAnalyzeDataDescriptionOutputFeatureNumeric < 3) { | 209 if (buildCounterAnalyzeDataDescriptionOutputFeatureNumeric < 3) { |
| 205 unittest.expect(o.count, unittest.equals('foo')); | 210 unittest.expect(o.count, unittest.equals('foo')); |
| 206 unittest.expect(o.mean, unittest.equals('foo')); | 211 unittest.expect(o.mean, unittest.equals('foo')); |
| 207 unittest.expect(o.variance, unittest.equals('foo')); | 212 unittest.expect(o.variance, unittest.equals('foo')); |
| 208 } | 213 } |
| 209 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric--; | 214 buildCounterAnalyzeDataDescriptionOutputFeatureNumeric--; |
| 210 } | 215 } |
| 211 | 216 |
| 212 core.int buildCounterAnalyzeDataDescriptionOutputFeatureText = 0; | 217 core.int buildCounterAnalyzeDataDescriptionOutputFeatureText = 0; |
| 213 buildAnalyzeDataDescriptionOutputFeatureText() { | 218 buildAnalyzeDataDescriptionOutputFeatureText() { |
| 214 var o = new api.AnalyzeDataDescriptionOutputFeatureText(); | 219 var o = new api.AnalyzeDataDescriptionOutputFeatureText(); |
| 215 buildCounterAnalyzeDataDescriptionOutputFeatureText++; | 220 buildCounterAnalyzeDataDescriptionOutputFeatureText++; |
| 216 if (buildCounterAnalyzeDataDescriptionOutputFeatureText < 3) { | 221 if (buildCounterAnalyzeDataDescriptionOutputFeatureText < 3) { |
| 217 o.count = "foo"; | 222 o.count = "foo"; |
| 218 o.value = "foo"; | 223 o.value = "foo"; |
| 219 } | 224 } |
| 220 buildCounterAnalyzeDataDescriptionOutputFeatureText--; | 225 buildCounterAnalyzeDataDescriptionOutputFeatureText--; |
| 221 return o; | 226 return o; |
| 222 } | 227 } |
| 223 | 228 |
| 224 checkAnalyzeDataDescriptionOutputFeatureText(api.AnalyzeDataDescriptionOutputFea
tureText o) { | 229 checkAnalyzeDataDescriptionOutputFeatureText( |
| 230 api.AnalyzeDataDescriptionOutputFeatureText o) { |
| 225 buildCounterAnalyzeDataDescriptionOutputFeatureText++; | 231 buildCounterAnalyzeDataDescriptionOutputFeatureText++; |
| 226 if (buildCounterAnalyzeDataDescriptionOutputFeatureText < 3) { | 232 if (buildCounterAnalyzeDataDescriptionOutputFeatureText < 3) { |
| 227 unittest.expect(o.count, unittest.equals('foo')); | 233 unittest.expect(o.count, unittest.equals('foo')); |
| 228 unittest.expect(o.value, unittest.equals('foo')); | 234 unittest.expect(o.value, unittest.equals('foo')); |
| 229 } | 235 } |
| 230 buildCounterAnalyzeDataDescriptionOutputFeatureText--; | 236 buildCounterAnalyzeDataDescriptionOutputFeatureText--; |
| 231 } | 237 } |
| 232 | 238 |
| 233 buildUnnamed1888() { | 239 buildUnnamed1886() { |
| 234 var o = new core.List<api.AnalyzeDataDescriptionOutputFeatureText>(); | 240 var o = new core.List<api.AnalyzeDataDescriptionOutputFeatureText>(); |
| 235 o.add(buildAnalyzeDataDescriptionOutputFeatureText()); | 241 o.add(buildAnalyzeDataDescriptionOutputFeatureText()); |
| 236 o.add(buildAnalyzeDataDescriptionOutputFeatureText()); | 242 o.add(buildAnalyzeDataDescriptionOutputFeatureText()); |
| 237 return o; | 243 return o; |
| 238 } | 244 } |
| 239 | 245 |
| 240 checkUnnamed1888(core.List<api.AnalyzeDataDescriptionOutputFeatureText> o) { | 246 checkUnnamed1886(core.List<api.AnalyzeDataDescriptionOutputFeatureText> o) { |
| 241 unittest.expect(o, unittest.hasLength(2)); | 247 unittest.expect(o, unittest.hasLength(2)); |
| 242 checkAnalyzeDataDescriptionOutputFeatureText(o[0]); | 248 checkAnalyzeDataDescriptionOutputFeatureText(o[0]); |
| 243 checkAnalyzeDataDescriptionOutputFeatureText(o[1]); | 249 checkAnalyzeDataDescriptionOutputFeatureText(o[1]); |
| 244 } | 250 } |
| 245 | 251 |
| 246 core.int buildCounterAnalyzeDataDescriptionOutputFeature = 0; | 252 core.int buildCounterAnalyzeDataDescriptionOutputFeature = 0; |
| 247 buildAnalyzeDataDescriptionOutputFeature() { | 253 buildAnalyzeDataDescriptionOutputFeature() { |
| 248 var o = new api.AnalyzeDataDescriptionOutputFeature(); | 254 var o = new api.AnalyzeDataDescriptionOutputFeature(); |
| 249 buildCounterAnalyzeDataDescriptionOutputFeature++; | 255 buildCounterAnalyzeDataDescriptionOutputFeature++; |
| 250 if (buildCounterAnalyzeDataDescriptionOutputFeature < 3) { | 256 if (buildCounterAnalyzeDataDescriptionOutputFeature < 3) { |
| 251 o.numeric = buildAnalyzeDataDescriptionOutputFeatureNumeric(); | 257 o.numeric = buildAnalyzeDataDescriptionOutputFeatureNumeric(); |
| 252 o.text = buildUnnamed1888(); | 258 o.text = buildUnnamed1886(); |
| 253 } | 259 } |
| 254 buildCounterAnalyzeDataDescriptionOutputFeature--; | 260 buildCounterAnalyzeDataDescriptionOutputFeature--; |
| 255 return o; | 261 return o; |
| 256 } | 262 } |
| 257 | 263 |
| 258 checkAnalyzeDataDescriptionOutputFeature(api.AnalyzeDataDescriptionOutputFeature
o) { | 264 checkAnalyzeDataDescriptionOutputFeature( |
| 265 api.AnalyzeDataDescriptionOutputFeature o) { |
| 259 buildCounterAnalyzeDataDescriptionOutputFeature++; | 266 buildCounterAnalyzeDataDescriptionOutputFeature++; |
| 260 if (buildCounterAnalyzeDataDescriptionOutputFeature < 3) { | 267 if (buildCounterAnalyzeDataDescriptionOutputFeature < 3) { |
| 261 checkAnalyzeDataDescriptionOutputFeatureNumeric(o.numeric); | 268 checkAnalyzeDataDescriptionOutputFeatureNumeric(o.numeric); |
| 262 checkUnnamed1888(o.text); | 269 checkUnnamed1886(o.text); |
| 263 } | 270 } |
| 264 buildCounterAnalyzeDataDescriptionOutputFeature--; | 271 buildCounterAnalyzeDataDescriptionOutputFeature--; |
| 265 } | 272 } |
| 266 | 273 |
| 267 core.int buildCounterAnalyzeDataDescription = 0; | 274 core.int buildCounterAnalyzeDataDescription = 0; |
| 268 buildAnalyzeDataDescription() { | 275 buildAnalyzeDataDescription() { |
| 269 var o = new api.AnalyzeDataDescription(); | 276 var o = new api.AnalyzeDataDescription(); |
| 270 buildCounterAnalyzeDataDescription++; | 277 buildCounterAnalyzeDataDescription++; |
| 271 if (buildCounterAnalyzeDataDescription < 3) { | 278 if (buildCounterAnalyzeDataDescription < 3) { |
| 272 o.features = buildUnnamed1887(); | 279 o.features = buildUnnamed1885(); |
| 273 o.outputFeature = buildAnalyzeDataDescriptionOutputFeature(); | 280 o.outputFeature = buildAnalyzeDataDescriptionOutputFeature(); |
| 274 } | 281 } |
| 275 buildCounterAnalyzeDataDescription--; | 282 buildCounterAnalyzeDataDescription--; |
| 276 return o; | 283 return o; |
| 277 } | 284 } |
| 278 | 285 |
| 279 checkAnalyzeDataDescription(api.AnalyzeDataDescription o) { | 286 checkAnalyzeDataDescription(api.AnalyzeDataDescription o) { |
| 280 buildCounterAnalyzeDataDescription++; | 287 buildCounterAnalyzeDataDescription++; |
| 281 if (buildCounterAnalyzeDataDescription < 3) { | 288 if (buildCounterAnalyzeDataDescription < 3) { |
| 282 checkUnnamed1887(o.features); | 289 checkUnnamed1885(o.features); |
| 283 checkAnalyzeDataDescriptionOutputFeature(o.outputFeature); | 290 checkAnalyzeDataDescriptionOutputFeature(o.outputFeature); |
| 284 } | 291 } |
| 285 buildCounterAnalyzeDataDescription--; | 292 buildCounterAnalyzeDataDescription--; |
| 286 } | 293 } |
| 287 | 294 |
| 295 buildUnnamed1887() { |
| 296 var o = new core.Map<core.String, core.String>(); |
| 297 o["x"] = "foo"; |
| 298 o["y"] = "foo"; |
| 299 return o; |
| 300 } |
| 301 |
| 302 checkUnnamed1887(core.Map<core.String, core.String> o) { |
| 303 unittest.expect(o, unittest.hasLength(2)); |
| 304 unittest.expect(o["x"], unittest.equals('foo')); |
| 305 unittest.expect(o["y"], unittest.equals('foo')); |
| 306 } |
| 307 |
| 308 buildUnnamed1888() { |
| 309 var o = new core.List<core.Map<core.String, core.String>>(); |
| 310 o.add(buildUnnamed1887()); |
| 311 o.add(buildUnnamed1887()); |
| 312 return o; |
| 313 } |
| 314 |
| 315 checkUnnamed1888(core.List<core.Map<core.String, core.String>> o) { |
| 316 unittest.expect(o, unittest.hasLength(2)); |
| 317 checkUnnamed1887(o[0]); |
| 318 checkUnnamed1887(o[1]); |
| 319 } |
| 320 |
| 288 buildUnnamed1889() { | 321 buildUnnamed1889() { |
| 289 var o = new core.Map<core.String, core.String>(); | 322 var o = new core.Map<core.String, core.String>(); |
| 290 o["x"] = "foo"; | 323 o["x"] = "foo"; |
| 291 o["y"] = "foo"; | 324 o["y"] = "foo"; |
| 292 return o; | 325 return o; |
| 293 } | 326 } |
| 294 | 327 |
| 295 checkUnnamed1889(core.Map<core.String, core.String> o) { | 328 checkUnnamed1889(core.Map<core.String, core.String> o) { |
| 296 unittest.expect(o, unittest.hasLength(2)); | 329 unittest.expect(o, unittest.hasLength(2)); |
| 297 unittest.expect(o["x"], unittest.equals('foo')); | 330 unittest.expect(o["x"], unittest.equals('foo')); |
| 298 unittest.expect(o["y"], unittest.equals('foo')); | 331 unittest.expect(o["y"], unittest.equals('foo')); |
| 299 } | 332 } |
| 300 | 333 |
| 301 buildUnnamed1890() { | 334 buildUnnamed1890() { |
| 302 var o = new core.List<core.Map<core.String, core.String>>(); | 335 var o = new core.Map<core.String, core.Map<core.String, core.String>>(); |
| 303 o.add(buildUnnamed1889()); | 336 o["x"] = buildUnnamed1889(); |
| 304 o.add(buildUnnamed1889()); | 337 o["y"] = buildUnnamed1889(); |
| 305 return o; | 338 return o; |
| 306 } | 339 } |
| 307 | 340 |
| 308 checkUnnamed1890(core.List<core.Map<core.String, core.String>> o) { | 341 checkUnnamed1890(core.Map<core.String, core.Map<core.String, core.String>> o) { |
| 309 unittest.expect(o, unittest.hasLength(2)); | 342 unittest.expect(o, unittest.hasLength(2)); |
| 310 checkUnnamed1889(o[0]); | 343 checkUnnamed1889(o["x"]); |
| 311 checkUnnamed1889(o[1]); | 344 checkUnnamed1889(o["y"]); |
| 312 } | 345 } |
| 313 | 346 |
| 314 buildUnnamed1891() { | 347 buildUnnamed1891() { |
| 315 var o = new core.Map<core.String, core.String>(); | 348 var o = new core.Map<core.String, core.String>(); |
| 316 o["x"] = "foo"; | 349 o["x"] = "foo"; |
| 317 o["y"] = "foo"; | 350 o["y"] = "foo"; |
| 318 return o; | 351 return o; |
| 319 } | 352 } |
| 320 | 353 |
| 321 checkUnnamed1891(core.Map<core.String, core.String> o) { | 354 checkUnnamed1891(core.Map<core.String, core.String> o) { |
| 322 unittest.expect(o, unittest.hasLength(2)); | 355 unittest.expect(o, unittest.hasLength(2)); |
| 323 unittest.expect(o["x"], unittest.equals('foo')); | 356 unittest.expect(o["x"], unittest.equals('foo')); |
| 324 unittest.expect(o["y"], unittest.equals('foo')); | 357 unittest.expect(o["y"], unittest.equals('foo')); |
| 325 } | |
| 326 | |
| 327 buildUnnamed1892() { | |
| 328 var o = new core.Map<core.String, core.Map<core.String, core.String>>(); | |
| 329 o["x"] = buildUnnamed1891(); | |
| 330 o["y"] = buildUnnamed1891(); | |
| 331 return o; | |
| 332 } | |
| 333 | |
| 334 checkUnnamed1892(core.Map<core.String, core.Map<core.String, core.String>> o) { | |
| 335 unittest.expect(o, unittest.hasLength(2)); | |
| 336 checkUnnamed1891(o["x"]); | |
| 337 checkUnnamed1891(o["y"]); | |
| 338 } | |
| 339 | |
| 340 buildUnnamed1893() { | |
| 341 var o = new core.Map<core.String, core.String>(); | |
| 342 o["x"] = "foo"; | |
| 343 o["y"] = "foo"; | |
| 344 return o; | |
| 345 } | |
| 346 | |
| 347 checkUnnamed1893(core.Map<core.String, core.String> o) { | |
| 348 unittest.expect(o, unittest.hasLength(2)); | |
| 349 unittest.expect(o["x"], unittest.equals('foo')); | |
| 350 unittest.expect(o["y"], unittest.equals('foo')); | |
| 351 } | 358 } |
| 352 | 359 |
| 353 core.int buildCounterAnalyzeModelDescription = 0; | 360 core.int buildCounterAnalyzeModelDescription = 0; |
| 354 buildAnalyzeModelDescription() { | 361 buildAnalyzeModelDescription() { |
| 355 var o = new api.AnalyzeModelDescription(); | 362 var o = new api.AnalyzeModelDescription(); |
| 356 buildCounterAnalyzeModelDescription++; | 363 buildCounterAnalyzeModelDescription++; |
| 357 if (buildCounterAnalyzeModelDescription < 3) { | 364 if (buildCounterAnalyzeModelDescription < 3) { |
| 358 o.confusionMatrix = buildUnnamed1892(); | 365 o.confusionMatrix = buildUnnamed1890(); |
| 359 o.confusionMatrixRowTotals = buildUnnamed1893(); | 366 o.confusionMatrixRowTotals = buildUnnamed1891(); |
| 360 o.modelinfo = buildInsert2(); | 367 o.modelinfo = buildInsert2(); |
| 361 } | 368 } |
| 362 buildCounterAnalyzeModelDescription--; | 369 buildCounterAnalyzeModelDescription--; |
| 363 return o; | 370 return o; |
| 364 } | 371 } |
| 365 | 372 |
| 366 checkAnalyzeModelDescription(api.AnalyzeModelDescription o) { | 373 checkAnalyzeModelDescription(api.AnalyzeModelDescription o) { |
| 367 buildCounterAnalyzeModelDescription++; | 374 buildCounterAnalyzeModelDescription++; |
| 368 if (buildCounterAnalyzeModelDescription < 3) { | 375 if (buildCounterAnalyzeModelDescription < 3) { |
| 369 checkUnnamed1892(o.confusionMatrix); | 376 checkUnnamed1890(o.confusionMatrix); |
| 370 checkUnnamed1893(o.confusionMatrixRowTotals); | 377 checkUnnamed1891(o.confusionMatrixRowTotals); |
| 371 checkInsert2(o.modelinfo); | 378 checkInsert2(o.modelinfo); |
| 372 } | 379 } |
| 373 buildCounterAnalyzeModelDescription--; | 380 buildCounterAnalyzeModelDescription--; |
| 374 } | 381 } |
| 375 | 382 |
| 376 core.int buildCounterAnalyze = 0; | 383 core.int buildCounterAnalyze = 0; |
| 377 buildAnalyze() { | 384 buildAnalyze() { |
| 378 var o = new api.Analyze(); | 385 var o = new api.Analyze(); |
| 379 buildCounterAnalyze++; | 386 buildCounterAnalyze++; |
| 380 if (buildCounterAnalyze < 3) { | 387 if (buildCounterAnalyze < 3) { |
| 381 o.dataDescription = buildAnalyzeDataDescription(); | 388 o.dataDescription = buildAnalyzeDataDescription(); |
| 382 o.errors = buildUnnamed1890(); | 389 o.errors = buildUnnamed1888(); |
| 383 o.id = "foo"; | 390 o.id = "foo"; |
| 384 o.kind = "foo"; | 391 o.kind = "foo"; |
| 385 o.modelDescription = buildAnalyzeModelDescription(); | 392 o.modelDescription = buildAnalyzeModelDescription(); |
| 386 o.selfLink = "foo"; | 393 o.selfLink = "foo"; |
| 387 } | 394 } |
| 388 buildCounterAnalyze--; | 395 buildCounterAnalyze--; |
| 389 return o; | 396 return o; |
| 390 } | 397 } |
| 391 | 398 |
| 392 checkAnalyze(api.Analyze o) { | 399 checkAnalyze(api.Analyze o) { |
| 393 buildCounterAnalyze++; | 400 buildCounterAnalyze++; |
| 394 if (buildCounterAnalyze < 3) { | 401 if (buildCounterAnalyze < 3) { |
| 395 checkAnalyzeDataDescription(o.dataDescription); | 402 checkAnalyzeDataDescription(o.dataDescription); |
| 396 checkUnnamed1890(o.errors); | 403 checkUnnamed1888(o.errors); |
| 397 unittest.expect(o.id, unittest.equals('foo')); | 404 unittest.expect(o.id, unittest.equals('foo')); |
| 398 unittest.expect(o.kind, unittest.equals('foo')); | 405 unittest.expect(o.kind, unittest.equals('foo')); |
| 399 checkAnalyzeModelDescription(o.modelDescription); | 406 checkAnalyzeModelDescription(o.modelDescription); |
| 400 unittest.expect(o.selfLink, unittest.equals('foo')); | 407 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 401 } | 408 } |
| 402 buildCounterAnalyze--; | 409 buildCounterAnalyze--; |
| 403 } | 410 } |
| 404 | 411 |
| 405 buildUnnamed1894() { | 412 buildUnnamed1892() { |
| 406 var o = new core.List<core.Object>(); | 413 var o = new core.List<core.Object>(); |
| 407 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 414 o.add({ |
| 408 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 415 'list': [1, 2, 3], |
| 416 'bool': true, |
| 417 'string': 'foo' |
| 418 }); |
| 419 o.add({ |
| 420 'list': [1, 2, 3], |
| 421 'bool': true, |
| 422 'string': 'foo' |
| 423 }); |
| 409 return o; | 424 return o; |
| 410 } | 425 } |
| 411 | 426 |
| 412 checkUnnamed1894(core.List<core.Object> o) { | 427 checkUnnamed1892(core.List<core.Object> o) { |
| 413 unittest.expect(o, unittest.hasLength(2)); | 428 unittest.expect(o, unittest.hasLength(2)); |
| 414 var casted1 = (o[0]) as core.Map; unittest.expect(casted1, unittest.hasLength(
3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"], u
nittest.equals('foo')); | 429 var casted1 = (o[0]) as core.Map; |
| 415 var casted2 = (o[1]) as core.Map; unittest.expect(casted2, unittest.hasLength(
3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"], u
nittest.equals('foo')); | 430 unittest.expect(casted1, unittest.hasLength(3)); |
| 431 unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); |
| 432 unittest.expect(casted1["bool"], unittest.equals(true)); |
| 433 unittest.expect(casted1["string"], unittest.equals('foo')); |
| 434 var casted2 = (o[1]) as core.Map; |
| 435 unittest.expect(casted2, unittest.hasLength(3)); |
| 436 unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); |
| 437 unittest.expect(casted2["bool"], unittest.equals(true)); |
| 438 unittest.expect(casted2["string"], unittest.equals('foo')); |
| 416 } | 439 } |
| 417 | 440 |
| 418 core.int buildCounterInputInput = 0; | 441 core.int buildCounterInputInput = 0; |
| 419 buildInputInput() { | 442 buildInputInput() { |
| 420 var o = new api.InputInput(); | 443 var o = new api.InputInput(); |
| 421 buildCounterInputInput++; | 444 buildCounterInputInput++; |
| 422 if (buildCounterInputInput < 3) { | 445 if (buildCounterInputInput < 3) { |
| 423 o.csvInstance = buildUnnamed1894(); | 446 o.csvInstance = buildUnnamed1892(); |
| 424 } | 447 } |
| 425 buildCounterInputInput--; | 448 buildCounterInputInput--; |
| 426 return o; | 449 return o; |
| 427 } | 450 } |
| 428 | 451 |
| 429 checkInputInput(api.InputInput o) { | 452 checkInputInput(api.InputInput o) { |
| 430 buildCounterInputInput++; | 453 buildCounterInputInput++; |
| 431 if (buildCounterInputInput < 3) { | 454 if (buildCounterInputInput < 3) { |
| 432 checkUnnamed1894(o.csvInstance); | 455 checkUnnamed1892(o.csvInstance); |
| 433 } | 456 } |
| 434 buildCounterInputInput--; | 457 buildCounterInputInput--; |
| 435 } | 458 } |
| 436 | 459 |
| 437 core.int buildCounterInput = 0; | 460 core.int buildCounterInput = 0; |
| 438 buildInput() { | 461 buildInput() { |
| 439 var o = new api.Input(); | 462 var o = new api.Input(); |
| 440 buildCounterInput++; | 463 buildCounterInput++; |
| 441 if (buildCounterInput < 3) { | 464 if (buildCounterInput < 3) { |
| 442 o.input = buildInputInput(); | 465 o.input = buildInputInput(); |
| 443 } | 466 } |
| 444 buildCounterInput--; | 467 buildCounterInput--; |
| 445 return o; | 468 return o; |
| 446 } | 469 } |
| 447 | 470 |
| 448 checkInput(api.Input o) { | 471 checkInput(api.Input o) { |
| 449 buildCounterInput++; | 472 buildCounterInput++; |
| 450 if (buildCounterInput < 3) { | 473 if (buildCounterInput < 3) { |
| 451 checkInputInput(o.input); | 474 checkInputInput(o.input); |
| 452 } | 475 } |
| 453 buildCounterInput--; | 476 buildCounterInput--; |
| 454 } | 477 } |
| 455 | 478 |
| 456 buildUnnamed1895() { | 479 buildUnnamed1893() { |
| 457 var o = new core.List<core.Object>(); | 480 var o = new core.List<core.Object>(); |
| 458 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 481 o.add({ |
| 459 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 482 'list': [1, 2, 3], |
| 483 'bool': true, |
| 484 'string': 'foo' |
| 485 }); |
| 486 o.add({ |
| 487 'list': [1, 2, 3], |
| 488 'bool': true, |
| 489 'string': 'foo' |
| 490 }); |
| 460 return o; | 491 return o; |
| 461 } | 492 } |
| 462 | 493 |
| 463 checkUnnamed1895(core.List<core.Object> o) { | 494 checkUnnamed1893(core.List<core.Object> o) { |
| 464 unittest.expect(o, unittest.hasLength(2)); | 495 unittest.expect(o, unittest.hasLength(2)); |
| 465 var casted3 = (o[0]) as core.Map; unittest.expect(casted3, unittest.hasLength(
3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"], u
nittest.equals('foo')); | 496 var casted3 = (o[0]) as core.Map; |
| 466 var casted4 = (o[1]) as core.Map; unittest.expect(casted4, unittest.hasLength(
3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"], u
nittest.equals('foo')); | 497 unittest.expect(casted3, unittest.hasLength(3)); |
| 498 unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); |
| 499 unittest.expect(casted3["bool"], unittest.equals(true)); |
| 500 unittest.expect(casted3["string"], unittest.equals('foo')); |
| 501 var casted4 = (o[1]) as core.Map; |
| 502 unittest.expect(casted4, unittest.hasLength(3)); |
| 503 unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); |
| 504 unittest.expect(casted4["bool"], unittest.equals(true)); |
| 505 unittest.expect(casted4["string"], unittest.equals('foo')); |
| 467 } | 506 } |
| 468 | 507 |
| 469 core.int buildCounterInsertTrainingInstances = 0; | 508 core.int buildCounterInsertTrainingInstances = 0; |
| 470 buildInsertTrainingInstances() { | 509 buildInsertTrainingInstances() { |
| 471 var o = new api.InsertTrainingInstances(); | 510 var o = new api.InsertTrainingInstances(); |
| 472 buildCounterInsertTrainingInstances++; | 511 buildCounterInsertTrainingInstances++; |
| 473 if (buildCounterInsertTrainingInstances < 3) { | 512 if (buildCounterInsertTrainingInstances < 3) { |
| 474 o.csvInstance = buildUnnamed1895(); | 513 o.csvInstance = buildUnnamed1893(); |
| 475 o.output = "foo"; | 514 o.output = "foo"; |
| 476 } | 515 } |
| 477 buildCounterInsertTrainingInstances--; | 516 buildCounterInsertTrainingInstances--; |
| 478 return o; | 517 return o; |
| 479 } | 518 } |
| 480 | 519 |
| 481 checkInsertTrainingInstances(api.InsertTrainingInstances o) { | 520 checkInsertTrainingInstances(api.InsertTrainingInstances o) { |
| 482 buildCounterInsertTrainingInstances++; | 521 buildCounterInsertTrainingInstances++; |
| 483 if (buildCounterInsertTrainingInstances < 3) { | 522 if (buildCounterInsertTrainingInstances < 3) { |
| 484 checkUnnamed1895(o.csvInstance); | 523 checkUnnamed1893(o.csvInstance); |
| 485 unittest.expect(o.output, unittest.equals('foo')); | 524 unittest.expect(o.output, unittest.equals('foo')); |
| 486 } | 525 } |
| 487 buildCounterInsertTrainingInstances--; | 526 buildCounterInsertTrainingInstances--; |
| 488 } | 527 } |
| 489 | 528 |
| 490 buildUnnamed1896() { | 529 buildUnnamed1894() { |
| 491 var o = new core.List<api.InsertTrainingInstances>(); | 530 var o = new core.List<api.InsertTrainingInstances>(); |
| 492 o.add(buildInsertTrainingInstances()); | 531 o.add(buildInsertTrainingInstances()); |
| 493 o.add(buildInsertTrainingInstances()); | 532 o.add(buildInsertTrainingInstances()); |
| 494 return o; | 533 return o; |
| 495 } | 534 } |
| 496 | 535 |
| 497 checkUnnamed1896(core.List<api.InsertTrainingInstances> o) { | 536 checkUnnamed1894(core.List<api.InsertTrainingInstances> o) { |
| 498 unittest.expect(o, unittest.hasLength(2)); | 537 unittest.expect(o, unittest.hasLength(2)); |
| 499 checkInsertTrainingInstances(o[0]); | 538 checkInsertTrainingInstances(o[0]); |
| 500 checkInsertTrainingInstances(o[1]); | 539 checkInsertTrainingInstances(o[1]); |
| 501 } | 540 } |
| 502 | 541 |
| 503 buildUnnamed1897() { | 542 buildUnnamed1895() { |
| 504 var o = new core.Map<core.String, core.double>(); | 543 var o = new core.Map<core.String, core.double>(); |
| 505 o["x"] = 42.0; | 544 o["x"] = 42.0; |
| 506 o["y"] = 42.0; | 545 o["y"] = 42.0; |
| 507 return o; | 546 return o; |
| 508 } | 547 } |
| 509 | 548 |
| 510 checkUnnamed1897(core.Map<core.String, core.double> o) { | 549 checkUnnamed1895(core.Map<core.String, core.double> o) { |
| 511 unittest.expect(o, unittest.hasLength(2)); | 550 unittest.expect(o, unittest.hasLength(2)); |
| 512 unittest.expect(o["x"], unittest.equals(42.0)); | 551 unittest.expect(o["x"], unittest.equals(42.0)); |
| 513 unittest.expect(o["y"], unittest.equals(42.0)); | 552 unittest.expect(o["y"], unittest.equals(42.0)); |
| 514 } | 553 } |
| 515 | 554 |
| 516 buildUnnamed1898() { | 555 buildUnnamed1896() { |
| 517 var o = new core.List<core.Map<core.String, core.double>>(); | 556 var o = new core.List<core.Map<core.String, core.double>>(); |
| 518 o.add(buildUnnamed1897()); | 557 o.add(buildUnnamed1895()); |
| 519 o.add(buildUnnamed1897()); | 558 o.add(buildUnnamed1895()); |
| 520 return o; | 559 return o; |
| 521 } | 560 } |
| 522 | 561 |
| 523 checkUnnamed1898(core.List<core.Map<core.String, core.double>> o) { | 562 checkUnnamed1896(core.List<core.Map<core.String, core.double>> o) { |
| 524 unittest.expect(o, unittest.hasLength(2)); | 563 unittest.expect(o, unittest.hasLength(2)); |
| 525 checkUnnamed1897(o[0]); | 564 checkUnnamed1895(o[0]); |
| 526 checkUnnamed1897(o[1]); | 565 checkUnnamed1895(o[1]); |
| 527 } | 566 } |
| 528 | 567 |
| 529 core.int buildCounterInsert = 0; | 568 core.int buildCounterInsert = 0; |
| 530 buildInsert() { | 569 buildInsert() { |
| 531 var o = new api.Insert(); | 570 var o = new api.Insert(); |
| 532 buildCounterInsert++; | 571 buildCounterInsert++; |
| 533 if (buildCounterInsert < 3) { | 572 if (buildCounterInsert < 3) { |
| 534 o.id = "foo"; | 573 o.id = "foo"; |
| 535 o.modelType = "foo"; | 574 o.modelType = "foo"; |
| 536 o.sourceModel = "foo"; | 575 o.sourceModel = "foo"; |
| 537 o.storageDataLocation = "foo"; | 576 o.storageDataLocation = "foo"; |
| 538 o.storagePMMLLocation = "foo"; | 577 o.storagePMMLLocation = "foo"; |
| 539 o.storagePMMLModelLocation = "foo"; | 578 o.storagePMMLModelLocation = "foo"; |
| 540 o.trainingInstances = buildUnnamed1896(); | 579 o.trainingInstances = buildUnnamed1894(); |
| 541 o.utility = buildUnnamed1898(); | 580 o.utility = buildUnnamed1896(); |
| 542 } | 581 } |
| 543 buildCounterInsert--; | 582 buildCounterInsert--; |
| 544 return o; | 583 return o; |
| 545 } | 584 } |
| 546 | 585 |
| 547 checkInsert(api.Insert o) { | 586 checkInsert(api.Insert o) { |
| 548 buildCounterInsert++; | 587 buildCounterInsert++; |
| 549 if (buildCounterInsert < 3) { | 588 if (buildCounterInsert < 3) { |
| 550 unittest.expect(o.id, unittest.equals('foo')); | 589 unittest.expect(o.id, unittest.equals('foo')); |
| 551 unittest.expect(o.modelType, unittest.equals('foo')); | 590 unittest.expect(o.modelType, unittest.equals('foo')); |
| 552 unittest.expect(o.sourceModel, unittest.equals('foo')); | 591 unittest.expect(o.sourceModel, unittest.equals('foo')); |
| 553 unittest.expect(o.storageDataLocation, unittest.equals('foo')); | 592 unittest.expect(o.storageDataLocation, unittest.equals('foo')); |
| 554 unittest.expect(o.storagePMMLLocation, unittest.equals('foo')); | 593 unittest.expect(o.storagePMMLLocation, unittest.equals('foo')); |
| 555 unittest.expect(o.storagePMMLModelLocation, unittest.equals('foo')); | 594 unittest.expect(o.storagePMMLModelLocation, unittest.equals('foo')); |
| 556 checkUnnamed1896(o.trainingInstances); | 595 checkUnnamed1894(o.trainingInstances); |
| 557 checkUnnamed1898(o.utility); | 596 checkUnnamed1896(o.utility); |
| 558 } | 597 } |
| 559 buildCounterInsert--; | 598 buildCounterInsert--; |
| 560 } | 599 } |
| 561 | 600 |
| 562 core.int buildCounterInsert2ModelInfo = 0; | 601 core.int buildCounterInsert2ModelInfo = 0; |
| 563 buildInsert2ModelInfo() { | 602 buildInsert2ModelInfo() { |
| 564 var o = new api.Insert2ModelInfo(); | 603 var o = new api.Insert2ModelInfo(); |
| 565 buildCounterInsert2ModelInfo++; | 604 buildCounterInsert2ModelInfo++; |
| 566 if (buildCounterInsert2ModelInfo < 3) { | 605 if (buildCounterInsert2ModelInfo < 3) { |
| 567 o.classWeightedAccuracy = "foo"; | 606 o.classWeightedAccuracy = "foo"; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 o.trainingComplete = core.DateTime.parse("2002-02-27T14:01:02"); | 644 o.trainingComplete = core.DateTime.parse("2002-02-27T14:01:02"); |
| 606 o.trainingStatus = "foo"; | 645 o.trainingStatus = "foo"; |
| 607 } | 646 } |
| 608 buildCounterInsert2--; | 647 buildCounterInsert2--; |
| 609 return o; | 648 return o; |
| 610 } | 649 } |
| 611 | 650 |
| 612 checkInsert2(api.Insert2 o) { | 651 checkInsert2(api.Insert2 o) { |
| 613 buildCounterInsert2++; | 652 buildCounterInsert2++; |
| 614 if (buildCounterInsert2 < 3) { | 653 if (buildCounterInsert2 < 3) { |
| 615 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); | 654 unittest.expect( |
| 655 o.created, unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 616 unittest.expect(o.id, unittest.equals('foo')); | 656 unittest.expect(o.id, unittest.equals('foo')); |
| 617 unittest.expect(o.kind, unittest.equals('foo')); | 657 unittest.expect(o.kind, unittest.equals('foo')); |
| 618 checkInsert2ModelInfo(o.modelInfo); | 658 checkInsert2ModelInfo(o.modelInfo); |
| 619 unittest.expect(o.modelType, unittest.equals('foo')); | 659 unittest.expect(o.modelType, unittest.equals('foo')); |
| 620 unittest.expect(o.selfLink, unittest.equals('foo')); | 660 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 621 unittest.expect(o.storageDataLocation, unittest.equals('foo')); | 661 unittest.expect(o.storageDataLocation, unittest.equals('foo')); |
| 622 unittest.expect(o.storagePMMLLocation, unittest.equals('foo')); | 662 unittest.expect(o.storagePMMLLocation, unittest.equals('foo')); |
| 623 unittest.expect(o.storagePMMLModelLocation, unittest.equals('foo')); | 663 unittest.expect(o.storagePMMLModelLocation, unittest.equals('foo')); |
| 624 unittest.expect(o.trainingComplete, unittest.equals(core.DateTime.parse("200
2-02-27T14:01:02"))); | 664 unittest.expect(o.trainingComplete, |
| 665 unittest.equals(core.DateTime.parse("2002-02-27T14:01:02"))); |
| 625 unittest.expect(o.trainingStatus, unittest.equals('foo')); | 666 unittest.expect(o.trainingStatus, unittest.equals('foo')); |
| 626 } | 667 } |
| 627 buildCounterInsert2--; | 668 buildCounterInsert2--; |
| 628 } | 669 } |
| 629 | 670 |
| 630 buildUnnamed1899() { | 671 buildUnnamed1897() { |
| 631 var o = new core.List<api.Insert2>(); | 672 var o = new core.List<api.Insert2>(); |
| 632 o.add(buildInsert2()); | 673 o.add(buildInsert2()); |
| 633 o.add(buildInsert2()); | 674 o.add(buildInsert2()); |
| 634 return o; | 675 return o; |
| 635 } | 676 } |
| 636 | 677 |
| 637 checkUnnamed1899(core.List<api.Insert2> o) { | 678 checkUnnamed1897(core.List<api.Insert2> o) { |
| 638 unittest.expect(o, unittest.hasLength(2)); | 679 unittest.expect(o, unittest.hasLength(2)); |
| 639 checkInsert2(o[0]); | 680 checkInsert2(o[0]); |
| 640 checkInsert2(o[1]); | 681 checkInsert2(o[1]); |
| 641 } | 682 } |
| 642 | 683 |
| 643 core.int buildCounterList = 0; | 684 core.int buildCounterList = 0; |
| 644 buildList() { | 685 buildList() { |
| 645 var o = new api.List(); | 686 var o = new api.List(); |
| 646 buildCounterList++; | 687 buildCounterList++; |
| 647 if (buildCounterList < 3) { | 688 if (buildCounterList < 3) { |
| 648 o.items = buildUnnamed1899(); | 689 o.items = buildUnnamed1897(); |
| 649 o.kind = "foo"; | 690 o.kind = "foo"; |
| 650 o.nextPageToken = "foo"; | 691 o.nextPageToken = "foo"; |
| 651 o.selfLink = "foo"; | 692 o.selfLink = "foo"; |
| 652 } | 693 } |
| 653 buildCounterList--; | 694 buildCounterList--; |
| 654 return o; | 695 return o; |
| 655 } | 696 } |
| 656 | 697 |
| 657 checkList(api.List o) { | 698 checkList(api.List o) { |
| 658 buildCounterList++; | 699 buildCounterList++; |
| 659 if (buildCounterList < 3) { | 700 if (buildCounterList < 3) { |
| 660 checkUnnamed1899(o.items); | 701 checkUnnamed1897(o.items); |
| 661 unittest.expect(o.kind, unittest.equals('foo')); | 702 unittest.expect(o.kind, unittest.equals('foo')); |
| 662 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 703 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 663 unittest.expect(o.selfLink, unittest.equals('foo')); | 704 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 664 } | 705 } |
| 665 buildCounterList--; | 706 buildCounterList--; |
| 666 } | 707 } |
| 667 | 708 |
| 668 core.int buildCounterOutputOutputMulti = 0; | 709 core.int buildCounterOutputOutputMulti = 0; |
| 669 buildOutputOutputMulti() { | 710 buildOutputOutputMulti() { |
| 670 var o = new api.OutputOutputMulti(); | 711 var o = new api.OutputOutputMulti(); |
| 671 buildCounterOutputOutputMulti++; | 712 buildCounterOutputOutputMulti++; |
| 672 if (buildCounterOutputOutputMulti < 3) { | 713 if (buildCounterOutputOutputMulti < 3) { |
| 673 o.label = "foo"; | 714 o.label = "foo"; |
| 674 o.score = "foo"; | 715 o.score = "foo"; |
| 675 } | 716 } |
| 676 buildCounterOutputOutputMulti--; | 717 buildCounterOutputOutputMulti--; |
| 677 return o; | 718 return o; |
| 678 } | 719 } |
| 679 | 720 |
| 680 checkOutputOutputMulti(api.OutputOutputMulti o) { | 721 checkOutputOutputMulti(api.OutputOutputMulti o) { |
| 681 buildCounterOutputOutputMulti++; | 722 buildCounterOutputOutputMulti++; |
| 682 if (buildCounterOutputOutputMulti < 3) { | 723 if (buildCounterOutputOutputMulti < 3) { |
| 683 unittest.expect(o.label, unittest.equals('foo')); | 724 unittest.expect(o.label, unittest.equals('foo')); |
| 684 unittest.expect(o.score, unittest.equals('foo')); | 725 unittest.expect(o.score, unittest.equals('foo')); |
| 685 } | 726 } |
| 686 buildCounterOutputOutputMulti--; | 727 buildCounterOutputOutputMulti--; |
| 687 } | 728 } |
| 688 | 729 |
| 689 buildUnnamed1900() { | 730 buildUnnamed1898() { |
| 690 var o = new core.List<api.OutputOutputMulti>(); | 731 var o = new core.List<api.OutputOutputMulti>(); |
| 691 o.add(buildOutputOutputMulti()); | 732 o.add(buildOutputOutputMulti()); |
| 692 o.add(buildOutputOutputMulti()); | 733 o.add(buildOutputOutputMulti()); |
| 693 return o; | 734 return o; |
| 694 } | 735 } |
| 695 | 736 |
| 696 checkUnnamed1900(core.List<api.OutputOutputMulti> o) { | 737 checkUnnamed1898(core.List<api.OutputOutputMulti> o) { |
| 697 unittest.expect(o, unittest.hasLength(2)); | 738 unittest.expect(o, unittest.hasLength(2)); |
| 698 checkOutputOutputMulti(o[0]); | 739 checkOutputOutputMulti(o[0]); |
| 699 checkOutputOutputMulti(o[1]); | 740 checkOutputOutputMulti(o[1]); |
| 700 } | 741 } |
| 701 | 742 |
| 702 core.int buildCounterOutput = 0; | 743 core.int buildCounterOutput = 0; |
| 703 buildOutput() { | 744 buildOutput() { |
| 704 var o = new api.Output(); | 745 var o = new api.Output(); |
| 705 buildCounterOutput++; | 746 buildCounterOutput++; |
| 706 if (buildCounterOutput < 3) { | 747 if (buildCounterOutput < 3) { |
| 707 o.id = "foo"; | 748 o.id = "foo"; |
| 708 o.kind = "foo"; | 749 o.kind = "foo"; |
| 709 o.outputLabel = "foo"; | 750 o.outputLabel = "foo"; |
| 710 o.outputMulti = buildUnnamed1900(); | 751 o.outputMulti = buildUnnamed1898(); |
| 711 o.outputValue = "foo"; | 752 o.outputValue = "foo"; |
| 712 o.selfLink = "foo"; | 753 o.selfLink = "foo"; |
| 713 } | 754 } |
| 714 buildCounterOutput--; | 755 buildCounterOutput--; |
| 715 return o; | 756 return o; |
| 716 } | 757 } |
| 717 | 758 |
| 718 checkOutput(api.Output o) { | 759 checkOutput(api.Output o) { |
| 719 buildCounterOutput++; | 760 buildCounterOutput++; |
| 720 if (buildCounterOutput < 3) { | 761 if (buildCounterOutput < 3) { |
| 721 unittest.expect(o.id, unittest.equals('foo')); | 762 unittest.expect(o.id, unittest.equals('foo')); |
| 722 unittest.expect(o.kind, unittest.equals('foo')); | 763 unittest.expect(o.kind, unittest.equals('foo')); |
| 723 unittest.expect(o.outputLabel, unittest.equals('foo')); | 764 unittest.expect(o.outputLabel, unittest.equals('foo')); |
| 724 checkUnnamed1900(o.outputMulti); | 765 checkUnnamed1898(o.outputMulti); |
| 725 unittest.expect(o.outputValue, unittest.equals('foo')); | 766 unittest.expect(o.outputValue, unittest.equals('foo')); |
| 726 unittest.expect(o.selfLink, unittest.equals('foo')); | 767 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 727 } | 768 } |
| 728 buildCounterOutput--; | 769 buildCounterOutput--; |
| 729 } | 770 } |
| 730 | 771 |
| 731 buildUnnamed1901() { | 772 buildUnnamed1899() { |
| 732 var o = new core.List<core.Object>(); | 773 var o = new core.List<core.Object>(); |
| 733 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 774 o.add({ |
| 734 o.add({'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}); | 775 'list': [1, 2, 3], |
| 776 'bool': true, |
| 777 'string': 'foo' |
| 778 }); |
| 779 o.add({ |
| 780 'list': [1, 2, 3], |
| 781 'bool': true, |
| 782 'string': 'foo' |
| 783 }); |
| 735 return o; | 784 return o; |
| 736 } | 785 } |
| 737 | 786 |
| 738 checkUnnamed1901(core.List<core.Object> o) { | 787 checkUnnamed1899(core.List<core.Object> o) { |
| 739 unittest.expect(o, unittest.hasLength(2)); | 788 unittest.expect(o, unittest.hasLength(2)); |
| 740 var casted5 = (o[0]) as core.Map; unittest.expect(casted5, unittest.hasLength(
3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"], u
nittest.equals('foo')); | 789 var casted5 = (o[0]) as core.Map; |
| 741 var casted6 = (o[1]) as core.Map; unittest.expect(casted6, unittest.hasLength(
3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.expe
ct(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"], u
nittest.equals('foo')); | 790 unittest.expect(casted5, unittest.hasLength(3)); |
| 791 unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); |
| 792 unittest.expect(casted5["bool"], unittest.equals(true)); |
| 793 unittest.expect(casted5["string"], unittest.equals('foo')); |
| 794 var casted6 = (o[1]) as core.Map; |
| 795 unittest.expect(casted6, unittest.hasLength(3)); |
| 796 unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); |
| 797 unittest.expect(casted6["bool"], unittest.equals(true)); |
| 798 unittest.expect(casted6["string"], unittest.equals('foo')); |
| 742 } | 799 } |
| 743 | 800 |
| 744 core.int buildCounterUpdate = 0; | 801 core.int buildCounterUpdate = 0; |
| 745 buildUpdate() { | 802 buildUpdate() { |
| 746 var o = new api.Update(); | 803 var o = new api.Update(); |
| 747 buildCounterUpdate++; | 804 buildCounterUpdate++; |
| 748 if (buildCounterUpdate < 3) { | 805 if (buildCounterUpdate < 3) { |
| 749 o.csvInstance = buildUnnamed1901(); | 806 o.csvInstance = buildUnnamed1899(); |
| 750 o.output = "foo"; | 807 o.output = "foo"; |
| 751 } | 808 } |
| 752 buildCounterUpdate--; | 809 buildCounterUpdate--; |
| 753 return o; | 810 return o; |
| 754 } | 811 } |
| 755 | 812 |
| 756 checkUpdate(api.Update o) { | 813 checkUpdate(api.Update o) { |
| 757 buildCounterUpdate++; | 814 buildCounterUpdate++; |
| 758 if (buildCounterUpdate < 3) { | 815 if (buildCounterUpdate < 3) { |
| 759 checkUnnamed1901(o.csvInstance); | 816 checkUnnamed1899(o.csvInstance); |
| 760 unittest.expect(o.output, unittest.equals('foo')); | 817 unittest.expect(o.output, unittest.equals('foo')); |
| 761 } | 818 } |
| 762 buildCounterUpdate--; | 819 buildCounterUpdate--; |
| 763 } | 820 } |
| 764 | 821 |
| 765 | |
| 766 main() { | 822 main() { |
| 767 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesCategoricalValues", (
) { | 823 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesCategoricalValues", |
| 824 () { |
| 768 unittest.test("to-json--from-json", () { | 825 unittest.test("to-json--from-json", () { |
| 769 var o = buildAnalyzeDataDescriptionFeaturesCategoricalValues(); | 826 var o = buildAnalyzeDataDescriptionFeaturesCategoricalValues(); |
| 770 var od = new api.AnalyzeDataDescriptionFeaturesCategoricalValues.fromJson(
o.toJson()); | 827 var od = new api.AnalyzeDataDescriptionFeaturesCategoricalValues.fromJson( |
| 828 o.toJson()); |
| 771 checkAnalyzeDataDescriptionFeaturesCategoricalValues(od); | 829 checkAnalyzeDataDescriptionFeaturesCategoricalValues(od); |
| 772 }); | 830 }); |
| 773 }); | 831 }); |
| 774 | 832 |
| 775 | |
| 776 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesCategorical", () { | 833 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesCategorical", () { |
| 777 unittest.test("to-json--from-json", () { | 834 unittest.test("to-json--from-json", () { |
| 778 var o = buildAnalyzeDataDescriptionFeaturesCategorical(); | 835 var o = buildAnalyzeDataDescriptionFeaturesCategorical(); |
| 779 var od = new api.AnalyzeDataDescriptionFeaturesCategorical.fromJson(o.toJs
on()); | 836 var od = new api.AnalyzeDataDescriptionFeaturesCategorical.fromJson( |
| 837 o.toJson()); |
| 780 checkAnalyzeDataDescriptionFeaturesCategorical(od); | 838 checkAnalyzeDataDescriptionFeaturesCategorical(od); |
| 781 }); | 839 }); |
| 782 }); | 840 }); |
| 783 | 841 |
| 784 | |
| 785 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesNumeric", () { | 842 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesNumeric", () { |
| 786 unittest.test("to-json--from-json", () { | 843 unittest.test("to-json--from-json", () { |
| 787 var o = buildAnalyzeDataDescriptionFeaturesNumeric(); | 844 var o = buildAnalyzeDataDescriptionFeaturesNumeric(); |
| 788 var od = new api.AnalyzeDataDescriptionFeaturesNumeric.fromJson(o.toJson()
); | 845 var od = |
| 846 new api.AnalyzeDataDescriptionFeaturesNumeric.fromJson(o.toJson()); |
| 789 checkAnalyzeDataDescriptionFeaturesNumeric(od); | 847 checkAnalyzeDataDescriptionFeaturesNumeric(od); |
| 790 }); | 848 }); |
| 791 }); | 849 }); |
| 792 | 850 |
| 793 | |
| 794 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesText", () { | 851 unittest.group("obj-schema-AnalyzeDataDescriptionFeaturesText", () { |
| 795 unittest.test("to-json--from-json", () { | 852 unittest.test("to-json--from-json", () { |
| 796 var o = buildAnalyzeDataDescriptionFeaturesText(); | 853 var o = buildAnalyzeDataDescriptionFeaturesText(); |
| 797 var od = new api.AnalyzeDataDescriptionFeaturesText.fromJson(o.toJson()); | 854 var od = new api.AnalyzeDataDescriptionFeaturesText.fromJson(o.toJson()); |
| 798 checkAnalyzeDataDescriptionFeaturesText(od); | 855 checkAnalyzeDataDescriptionFeaturesText(od); |
| 799 }); | 856 }); |
| 800 }); | 857 }); |
| 801 | 858 |
| 802 | |
| 803 unittest.group("obj-schema-AnalyzeDataDescriptionFeatures", () { | 859 unittest.group("obj-schema-AnalyzeDataDescriptionFeatures", () { |
| 804 unittest.test("to-json--from-json", () { | 860 unittest.test("to-json--from-json", () { |
| 805 var o = buildAnalyzeDataDescriptionFeatures(); | 861 var o = buildAnalyzeDataDescriptionFeatures(); |
| 806 var od = new api.AnalyzeDataDescriptionFeatures.fromJson(o.toJson()); | 862 var od = new api.AnalyzeDataDescriptionFeatures.fromJson(o.toJson()); |
| 807 checkAnalyzeDataDescriptionFeatures(od); | 863 checkAnalyzeDataDescriptionFeatures(od); |
| 808 }); | 864 }); |
| 809 }); | 865 }); |
| 810 | 866 |
| 811 | |
| 812 unittest.group("obj-schema-AnalyzeDataDescriptionOutputFeatureNumeric", () { | 867 unittest.group("obj-schema-AnalyzeDataDescriptionOutputFeatureNumeric", () { |
| 813 unittest.test("to-json--from-json", () { | 868 unittest.test("to-json--from-json", () { |
| 814 var o = buildAnalyzeDataDescriptionOutputFeatureNumeric(); | 869 var o = buildAnalyzeDataDescriptionOutputFeatureNumeric(); |
| 815 var od = new api.AnalyzeDataDescriptionOutputFeatureNumeric.fromJson(o.toJ
son()); | 870 var od = new api.AnalyzeDataDescriptionOutputFeatureNumeric.fromJson( |
| 871 o.toJson()); |
| 816 checkAnalyzeDataDescriptionOutputFeatureNumeric(od); | 872 checkAnalyzeDataDescriptionOutputFeatureNumeric(od); |
| 817 }); | 873 }); |
| 818 }); | 874 }); |
| 819 | 875 |
| 820 | |
| 821 unittest.group("obj-schema-AnalyzeDataDescriptionOutputFeatureText", () { | 876 unittest.group("obj-schema-AnalyzeDataDescriptionOutputFeatureText", () { |
| 822 unittest.test("to-json--from-json", () { | 877 unittest.test("to-json--from-json", () { |
| 823 var o = buildAnalyzeDataDescriptionOutputFeatureText(); | 878 var o = buildAnalyzeDataDescriptionOutputFeatureText(); |
| 824 var od = new api.AnalyzeDataDescriptionOutputFeatureText.fromJson(o.toJson
()); | 879 var od = |
| 880 new api.AnalyzeDataDescriptionOutputFeatureText.fromJson(o.toJson()); |
| 825 checkAnalyzeDataDescriptionOutputFeatureText(od); | 881 checkAnalyzeDataDescriptionOutputFeatureText(od); |
| 826 }); | 882 }); |
| 827 }); | 883 }); |
| 828 | 884 |
| 829 | |
| 830 unittest.group("obj-schema-AnalyzeDataDescriptionOutputFeature", () { | 885 unittest.group("obj-schema-AnalyzeDataDescriptionOutputFeature", () { |
| 831 unittest.test("to-json--from-json", () { | 886 unittest.test("to-json--from-json", () { |
| 832 var o = buildAnalyzeDataDescriptionOutputFeature(); | 887 var o = buildAnalyzeDataDescriptionOutputFeature(); |
| 833 var od = new api.AnalyzeDataDescriptionOutputFeature.fromJson(o.toJson()); | 888 var od = new api.AnalyzeDataDescriptionOutputFeature.fromJson(o.toJson()); |
| 834 checkAnalyzeDataDescriptionOutputFeature(od); | 889 checkAnalyzeDataDescriptionOutputFeature(od); |
| 835 }); | 890 }); |
| 836 }); | 891 }); |
| 837 | 892 |
| 838 | |
| 839 unittest.group("obj-schema-AnalyzeDataDescription", () { | 893 unittest.group("obj-schema-AnalyzeDataDescription", () { |
| 840 unittest.test("to-json--from-json", () { | 894 unittest.test("to-json--from-json", () { |
| 841 var o = buildAnalyzeDataDescription(); | 895 var o = buildAnalyzeDataDescription(); |
| 842 var od = new api.AnalyzeDataDescription.fromJson(o.toJson()); | 896 var od = new api.AnalyzeDataDescription.fromJson(o.toJson()); |
| 843 checkAnalyzeDataDescription(od); | 897 checkAnalyzeDataDescription(od); |
| 844 }); | 898 }); |
| 845 }); | 899 }); |
| 846 | 900 |
| 847 | |
| 848 unittest.group("obj-schema-AnalyzeModelDescription", () { | 901 unittest.group("obj-schema-AnalyzeModelDescription", () { |
| 849 unittest.test("to-json--from-json", () { | 902 unittest.test("to-json--from-json", () { |
| 850 var o = buildAnalyzeModelDescription(); | 903 var o = buildAnalyzeModelDescription(); |
| 851 var od = new api.AnalyzeModelDescription.fromJson(o.toJson()); | 904 var od = new api.AnalyzeModelDescription.fromJson(o.toJson()); |
| 852 checkAnalyzeModelDescription(od); | 905 checkAnalyzeModelDescription(od); |
| 853 }); | 906 }); |
| 854 }); | 907 }); |
| 855 | 908 |
| 856 | |
| 857 unittest.group("obj-schema-Analyze", () { | 909 unittest.group("obj-schema-Analyze", () { |
| 858 unittest.test("to-json--from-json", () { | 910 unittest.test("to-json--from-json", () { |
| 859 var o = buildAnalyze(); | 911 var o = buildAnalyze(); |
| 860 var od = new api.Analyze.fromJson(o.toJson()); | 912 var od = new api.Analyze.fromJson(o.toJson()); |
| 861 checkAnalyze(od); | 913 checkAnalyze(od); |
| 862 }); | 914 }); |
| 863 }); | 915 }); |
| 864 | 916 |
| 865 | |
| 866 unittest.group("obj-schema-InputInput", () { | 917 unittest.group("obj-schema-InputInput", () { |
| 867 unittest.test("to-json--from-json", () { | 918 unittest.test("to-json--from-json", () { |
| 868 var o = buildInputInput(); | 919 var o = buildInputInput(); |
| 869 var od = new api.InputInput.fromJson(o.toJson()); | 920 var od = new api.InputInput.fromJson(o.toJson()); |
| 870 checkInputInput(od); | 921 checkInputInput(od); |
| 871 }); | 922 }); |
| 872 }); | 923 }); |
| 873 | 924 |
| 874 | |
| 875 unittest.group("obj-schema-Input", () { | 925 unittest.group("obj-schema-Input", () { |
| 876 unittest.test("to-json--from-json", () { | 926 unittest.test("to-json--from-json", () { |
| 877 var o = buildInput(); | 927 var o = buildInput(); |
| 878 var od = new api.Input.fromJson(o.toJson()); | 928 var od = new api.Input.fromJson(o.toJson()); |
| 879 checkInput(od); | 929 checkInput(od); |
| 880 }); | 930 }); |
| 881 }); | 931 }); |
| 882 | 932 |
| 883 | |
| 884 unittest.group("obj-schema-InsertTrainingInstances", () { | 933 unittest.group("obj-schema-InsertTrainingInstances", () { |
| 885 unittest.test("to-json--from-json", () { | 934 unittest.test("to-json--from-json", () { |
| 886 var o = buildInsertTrainingInstances(); | 935 var o = buildInsertTrainingInstances(); |
| 887 var od = new api.InsertTrainingInstances.fromJson(o.toJson()); | 936 var od = new api.InsertTrainingInstances.fromJson(o.toJson()); |
| 888 checkInsertTrainingInstances(od); | 937 checkInsertTrainingInstances(od); |
| 889 }); | 938 }); |
| 890 }); | 939 }); |
| 891 | 940 |
| 892 | |
| 893 unittest.group("obj-schema-Insert", () { | 941 unittest.group("obj-schema-Insert", () { |
| 894 unittest.test("to-json--from-json", () { | 942 unittest.test("to-json--from-json", () { |
| 895 var o = buildInsert(); | 943 var o = buildInsert(); |
| 896 var od = new api.Insert.fromJson(o.toJson()); | 944 var od = new api.Insert.fromJson(o.toJson()); |
| 897 checkInsert(od); | 945 checkInsert(od); |
| 898 }); | 946 }); |
| 899 }); | 947 }); |
| 900 | 948 |
| 901 | |
| 902 unittest.group("obj-schema-Insert2ModelInfo", () { | 949 unittest.group("obj-schema-Insert2ModelInfo", () { |
| 903 unittest.test("to-json--from-json", () { | 950 unittest.test("to-json--from-json", () { |
| 904 var o = buildInsert2ModelInfo(); | 951 var o = buildInsert2ModelInfo(); |
| 905 var od = new api.Insert2ModelInfo.fromJson(o.toJson()); | 952 var od = new api.Insert2ModelInfo.fromJson(o.toJson()); |
| 906 checkInsert2ModelInfo(od); | 953 checkInsert2ModelInfo(od); |
| 907 }); | 954 }); |
| 908 }); | 955 }); |
| 909 | 956 |
| 910 | |
| 911 unittest.group("obj-schema-Insert2", () { | 957 unittest.group("obj-schema-Insert2", () { |
| 912 unittest.test("to-json--from-json", () { | 958 unittest.test("to-json--from-json", () { |
| 913 var o = buildInsert2(); | 959 var o = buildInsert2(); |
| 914 var od = new api.Insert2.fromJson(o.toJson()); | 960 var od = new api.Insert2.fromJson(o.toJson()); |
| 915 checkInsert2(od); | 961 checkInsert2(od); |
| 916 }); | 962 }); |
| 917 }); | 963 }); |
| 918 | 964 |
| 919 | |
| 920 unittest.group("obj-schema-List", () { | 965 unittest.group("obj-schema-List", () { |
| 921 unittest.test("to-json--from-json", () { | 966 unittest.test("to-json--from-json", () { |
| 922 var o = buildList(); | 967 var o = buildList(); |
| 923 var od = new api.List.fromJson(o.toJson()); | 968 var od = new api.List.fromJson(o.toJson()); |
| 924 checkList(od); | 969 checkList(od); |
| 925 }); | 970 }); |
| 926 }); | 971 }); |
| 927 | 972 |
| 928 | |
| 929 unittest.group("obj-schema-OutputOutputMulti", () { | 973 unittest.group("obj-schema-OutputOutputMulti", () { |
| 930 unittest.test("to-json--from-json", () { | 974 unittest.test("to-json--from-json", () { |
| 931 var o = buildOutputOutputMulti(); | 975 var o = buildOutputOutputMulti(); |
| 932 var od = new api.OutputOutputMulti.fromJson(o.toJson()); | 976 var od = new api.OutputOutputMulti.fromJson(o.toJson()); |
| 933 checkOutputOutputMulti(od); | 977 checkOutputOutputMulti(od); |
| 934 }); | 978 }); |
| 935 }); | 979 }); |
| 936 | 980 |
| 937 | |
| 938 unittest.group("obj-schema-Output", () { | 981 unittest.group("obj-schema-Output", () { |
| 939 unittest.test("to-json--from-json", () { | 982 unittest.test("to-json--from-json", () { |
| 940 var o = buildOutput(); | 983 var o = buildOutput(); |
| 941 var od = new api.Output.fromJson(o.toJson()); | 984 var od = new api.Output.fromJson(o.toJson()); |
| 942 checkOutput(od); | 985 checkOutput(od); |
| 943 }); | 986 }); |
| 944 }); | 987 }); |
| 945 | 988 |
| 946 | |
| 947 unittest.group("obj-schema-Update", () { | 989 unittest.group("obj-schema-Update", () { |
| 948 unittest.test("to-json--from-json", () { | 990 unittest.test("to-json--from-json", () { |
| 949 var o = buildUpdate(); | 991 var o = buildUpdate(); |
| 950 var od = new api.Update.fromJson(o.toJson()); | 992 var od = new api.Update.fromJson(o.toJson()); |
| 951 checkUpdate(od); | 993 checkUpdate(od); |
| 952 }); | 994 }); |
| 953 }); | 995 }); |
| 954 | 996 |
| 955 | |
| 956 unittest.group("resource-HostedmodelsResourceApi", () { | 997 unittest.group("resource-HostedmodelsResourceApi", () { |
| 957 unittest.test("method--predict", () { | 998 unittest.test("method--predict", () { |
| 958 | |
| 959 var mock = new HttpServerMock(); | 999 var mock = new HttpServerMock(); |
| 960 api.HostedmodelsResourceApi res = new api.PredictionApi(mock).hostedmodels
; | 1000 api.HostedmodelsResourceApi res = |
| 1001 new api.PredictionApi(mock).hostedmodels; |
| 961 var arg_request = buildInput(); | 1002 var arg_request = buildInput(); |
| 962 var arg_project = "foo"; | 1003 var arg_project = "foo"; |
| 963 var arg_hostedModelName = "foo"; | 1004 var arg_hostedModelName = "foo"; |
| 964 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1005 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 965 var obj = new api.Input.fromJson(json); | 1006 var obj = new api.Input.fromJson(json); |
| 966 checkInput(obj); | 1007 checkInput(obj); |
| 967 | 1008 |
| 968 var path = (req.url).path; | 1009 var path = (req.url).path; |
| 969 var pathOffset = 0; | 1010 var pathOffset = 0; |
| 970 var index; | 1011 var index; |
| 971 var subPart; | 1012 var subPart; |
| 972 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1013 unittest.expect( |
| 1014 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 973 pathOffset += 1; | 1015 pathOffset += 1; |
| 974 | 1016 |
| 975 var query = (req.url).query; | 1017 var query = (req.url).query; |
| 976 var queryOffset = 0; | 1018 var queryOffset = 0; |
| 977 var queryMap = {}; | 1019 var queryMap = {}; |
| 978 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1020 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 979 parseBool(n) { | 1021 parseBool(n) { |
| 980 if (n == "true") return true; | 1022 if (n == "true") return true; |
| 981 if (n == "false") return false; | 1023 if (n == "false") return false; |
| 982 if (n == null) return null; | 1024 if (n == null) return null; |
| 983 throw new core.ArgumentError("Invalid boolean: $n"); | 1025 throw new core.ArgumentError("Invalid boolean: $n"); |
| 984 } | 1026 } |
| 1027 |
| 985 if (query.length > 0) { | 1028 if (query.length > 0) { |
| 986 for (var part in query.split("&")) { | 1029 for (var part in query.split("&")) { |
| 987 var keyvalue = part.split("="); | 1030 var keyvalue = part.split("="); |
| 988 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1031 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1032 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 989 } | 1033 } |
| 990 } | 1034 } |
| 991 | 1035 |
| 992 | |
| 993 var h = { | 1036 var h = { |
| 994 "content-type" : "application/json; charset=utf-8", | 1037 "content-type": "application/json; charset=utf-8", |
| 995 }; | 1038 }; |
| 996 var resp = convert.JSON.encode(buildOutput()); | 1039 var resp = convert.JSON.encode(buildOutput()); |
| 997 return new async.Future.value(stringResponse(200, h, resp)); | 1040 return new async.Future.value(stringResponse(200, h, resp)); |
| 998 }), true); | 1041 }), true); |
| 999 res.predict(arg_request, arg_project, arg_hostedModelName).then(unittest.e
xpectAsync1(((api.Output response) { | 1042 res |
| 1043 .predict(arg_request, arg_project, arg_hostedModelName) |
| 1044 .then(unittest.expectAsync1(((api.Output response) { |
| 1000 checkOutput(response); | 1045 checkOutput(response); |
| 1001 }))); | 1046 }))); |
| 1002 }); | 1047 }); |
| 1003 | |
| 1004 }); | 1048 }); |
| 1005 | 1049 |
| 1006 | |
| 1007 unittest.group("resource-TrainedmodelsResourceApi", () { | 1050 unittest.group("resource-TrainedmodelsResourceApi", () { |
| 1008 unittest.test("method--analyze", () { | 1051 unittest.test("method--analyze", () { |
| 1009 | |
| 1010 var mock = new HttpServerMock(); | 1052 var mock = new HttpServerMock(); |
| 1011 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1053 api.TrainedmodelsResourceApi res = |
| 1054 new api.PredictionApi(mock).trainedmodels; |
| 1012 var arg_project = "foo"; | 1055 var arg_project = "foo"; |
| 1013 var arg_id = "foo"; | 1056 var arg_id = "foo"; |
| 1014 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1057 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1015 var path = (req.url).path; | 1058 var path = (req.url).path; |
| 1016 var pathOffset = 0; | 1059 var pathOffset = 0; |
| 1017 var index; | 1060 var index; |
| 1018 var subPart; | 1061 var subPart; |
| 1019 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1062 unittest.expect( |
| 1063 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1020 pathOffset += 1; | 1064 pathOffset += 1; |
| 1021 | 1065 |
| 1022 var query = (req.url).query; | 1066 var query = (req.url).query; |
| 1023 var queryOffset = 0; | 1067 var queryOffset = 0; |
| 1024 var queryMap = {}; | 1068 var queryMap = {}; |
| 1025 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1069 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1026 parseBool(n) { | 1070 parseBool(n) { |
| 1027 if (n == "true") return true; | 1071 if (n == "true") return true; |
| 1028 if (n == "false") return false; | 1072 if (n == "false") return false; |
| 1029 if (n == null) return null; | 1073 if (n == null) return null; |
| 1030 throw new core.ArgumentError("Invalid boolean: $n"); | 1074 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1031 } | 1075 } |
| 1076 |
| 1032 if (query.length > 0) { | 1077 if (query.length > 0) { |
| 1033 for (var part in query.split("&")) { | 1078 for (var part in query.split("&")) { |
| 1034 var keyvalue = part.split("="); | 1079 var keyvalue = part.split("="); |
| 1035 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1080 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1081 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1036 } | 1082 } |
| 1037 } | 1083 } |
| 1038 | 1084 |
| 1039 | |
| 1040 var h = { | 1085 var h = { |
| 1041 "content-type" : "application/json; charset=utf-8", | 1086 "content-type": "application/json; charset=utf-8", |
| 1042 }; | 1087 }; |
| 1043 var resp = convert.JSON.encode(buildAnalyze()); | 1088 var resp = convert.JSON.encode(buildAnalyze()); |
| 1044 return new async.Future.value(stringResponse(200, h, resp)); | 1089 return new async.Future.value(stringResponse(200, h, resp)); |
| 1045 }), true); | 1090 }), true); |
| 1046 res.analyze(arg_project, arg_id).then(unittest.expectAsync1(((api.Analyze
response) { | 1091 res |
| 1092 .analyze(arg_project, arg_id) |
| 1093 .then(unittest.expectAsync1(((api.Analyze response) { |
| 1047 checkAnalyze(response); | 1094 checkAnalyze(response); |
| 1048 }))); | 1095 }))); |
| 1049 }); | 1096 }); |
| 1050 | 1097 |
| 1051 unittest.test("method--delete", () { | 1098 unittest.test("method--delete", () { |
| 1052 | |
| 1053 var mock = new HttpServerMock(); | 1099 var mock = new HttpServerMock(); |
| 1054 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1100 api.TrainedmodelsResourceApi res = |
| 1101 new api.PredictionApi(mock).trainedmodels; |
| 1055 var arg_project = "foo"; | 1102 var arg_project = "foo"; |
| 1056 var arg_id = "foo"; | 1103 var arg_id = "foo"; |
| 1057 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1104 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1058 var path = (req.url).path; | 1105 var path = (req.url).path; |
| 1059 var pathOffset = 0; | 1106 var pathOffset = 0; |
| 1060 var index; | 1107 var index; |
| 1061 var subPart; | 1108 var subPart; |
| 1062 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1109 unittest.expect( |
| 1110 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1063 pathOffset += 1; | 1111 pathOffset += 1; |
| 1064 | 1112 |
| 1065 var query = (req.url).query; | 1113 var query = (req.url).query; |
| 1066 var queryOffset = 0; | 1114 var queryOffset = 0; |
| 1067 var queryMap = {}; | 1115 var queryMap = {}; |
| 1068 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1116 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1069 parseBool(n) { | 1117 parseBool(n) { |
| 1070 if (n == "true") return true; | 1118 if (n == "true") return true; |
| 1071 if (n == "false") return false; | 1119 if (n == "false") return false; |
| 1072 if (n == null) return null; | 1120 if (n == null) return null; |
| 1073 throw new core.ArgumentError("Invalid boolean: $n"); | 1121 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1074 } | 1122 } |
| 1123 |
| 1075 if (query.length > 0) { | 1124 if (query.length > 0) { |
| 1076 for (var part in query.split("&")) { | 1125 for (var part in query.split("&")) { |
| 1077 var keyvalue = part.split("="); | 1126 var keyvalue = part.split("="); |
| 1078 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1127 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1128 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1079 } | 1129 } |
| 1080 } | 1130 } |
| 1081 | 1131 |
| 1082 | |
| 1083 var h = { | 1132 var h = { |
| 1084 "content-type" : "application/json; charset=utf-8", | 1133 "content-type": "application/json; charset=utf-8", |
| 1085 }; | 1134 }; |
| 1086 var resp = ""; | 1135 var resp = ""; |
| 1087 return new async.Future.value(stringResponse(200, h, resp)); | 1136 return new async.Future.value(stringResponse(200, h, resp)); |
| 1088 }), true); | 1137 }), true); |
| 1089 res.delete(arg_project, arg_id).then(unittest.expectAsync1((_) {})); | 1138 res.delete(arg_project, arg_id).then(unittest.expectAsync1((_) {})); |
| 1090 }); | 1139 }); |
| 1091 | 1140 |
| 1092 unittest.test("method--get", () { | 1141 unittest.test("method--get", () { |
| 1093 | |
| 1094 var mock = new HttpServerMock(); | 1142 var mock = new HttpServerMock(); |
| 1095 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1143 api.TrainedmodelsResourceApi res = |
| 1144 new api.PredictionApi(mock).trainedmodels; |
| 1096 var arg_project = "foo"; | 1145 var arg_project = "foo"; |
| 1097 var arg_id = "foo"; | 1146 var arg_id = "foo"; |
| 1098 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1147 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1099 var path = (req.url).path; | 1148 var path = (req.url).path; |
| 1100 var pathOffset = 0; | 1149 var pathOffset = 0; |
| 1101 var index; | 1150 var index; |
| 1102 var subPart; | 1151 var subPart; |
| 1103 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1152 unittest.expect( |
| 1153 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1104 pathOffset += 1; | 1154 pathOffset += 1; |
| 1105 | 1155 |
| 1106 var query = (req.url).query; | 1156 var query = (req.url).query; |
| 1107 var queryOffset = 0; | 1157 var queryOffset = 0; |
| 1108 var queryMap = {}; | 1158 var queryMap = {}; |
| 1109 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1159 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1110 parseBool(n) { | 1160 parseBool(n) { |
| 1111 if (n == "true") return true; | 1161 if (n == "true") return true; |
| 1112 if (n == "false") return false; | 1162 if (n == "false") return false; |
| 1113 if (n == null) return null; | 1163 if (n == null) return null; |
| 1114 throw new core.ArgumentError("Invalid boolean: $n"); | 1164 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1115 } | 1165 } |
| 1166 |
| 1116 if (query.length > 0) { | 1167 if (query.length > 0) { |
| 1117 for (var part in query.split("&")) { | 1168 for (var part in query.split("&")) { |
| 1118 var keyvalue = part.split("="); | 1169 var keyvalue = part.split("="); |
| 1119 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1170 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1171 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1120 } | 1172 } |
| 1121 } | 1173 } |
| 1122 | 1174 |
| 1123 | |
| 1124 var h = { | 1175 var h = { |
| 1125 "content-type" : "application/json; charset=utf-8", | 1176 "content-type": "application/json; charset=utf-8", |
| 1126 }; | 1177 }; |
| 1127 var resp = convert.JSON.encode(buildInsert2()); | 1178 var resp = convert.JSON.encode(buildInsert2()); |
| 1128 return new async.Future.value(stringResponse(200, h, resp)); | 1179 return new async.Future.value(stringResponse(200, h, resp)); |
| 1129 }), true); | 1180 }), true); |
| 1130 res.get(arg_project, arg_id).then(unittest.expectAsync1(((api.Insert2 resp
onse) { | 1181 res |
| 1182 .get(arg_project, arg_id) |
| 1183 .then(unittest.expectAsync1(((api.Insert2 response) { |
| 1131 checkInsert2(response); | 1184 checkInsert2(response); |
| 1132 }))); | 1185 }))); |
| 1133 }); | 1186 }); |
| 1134 | 1187 |
| 1135 unittest.test("method--insert", () { | 1188 unittest.test("method--insert", () { |
| 1136 | |
| 1137 var mock = new HttpServerMock(); | 1189 var mock = new HttpServerMock(); |
| 1138 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1190 api.TrainedmodelsResourceApi res = |
| 1191 new api.PredictionApi(mock).trainedmodels; |
| 1139 var arg_request = buildInsert(); | 1192 var arg_request = buildInsert(); |
| 1140 var arg_project = "foo"; | 1193 var arg_project = "foo"; |
| 1141 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1194 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1142 var obj = new api.Insert.fromJson(json); | 1195 var obj = new api.Insert.fromJson(json); |
| 1143 checkInsert(obj); | 1196 checkInsert(obj); |
| 1144 | 1197 |
| 1145 var path = (req.url).path; | 1198 var path = (req.url).path; |
| 1146 var pathOffset = 0; | 1199 var pathOffset = 0; |
| 1147 var index; | 1200 var index; |
| 1148 var subPart; | 1201 var subPart; |
| 1149 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1202 unittest.expect( |
| 1203 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1150 pathOffset += 1; | 1204 pathOffset += 1; |
| 1151 | 1205 |
| 1152 var query = (req.url).query; | 1206 var query = (req.url).query; |
| 1153 var queryOffset = 0; | 1207 var queryOffset = 0; |
| 1154 var queryMap = {}; | 1208 var queryMap = {}; |
| 1155 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1209 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1156 parseBool(n) { | 1210 parseBool(n) { |
| 1157 if (n == "true") return true; | 1211 if (n == "true") return true; |
| 1158 if (n == "false") return false; | 1212 if (n == "false") return false; |
| 1159 if (n == null) return null; | 1213 if (n == null) return null; |
| 1160 throw new core.ArgumentError("Invalid boolean: $n"); | 1214 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1161 } | 1215 } |
| 1216 |
| 1162 if (query.length > 0) { | 1217 if (query.length > 0) { |
| 1163 for (var part in query.split("&")) { | 1218 for (var part in query.split("&")) { |
| 1164 var keyvalue = part.split("="); | 1219 var keyvalue = part.split("="); |
| 1165 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1220 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1221 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1166 } | 1222 } |
| 1167 } | 1223 } |
| 1168 | 1224 |
| 1169 | |
| 1170 var h = { | 1225 var h = { |
| 1171 "content-type" : "application/json; charset=utf-8", | 1226 "content-type": "application/json; charset=utf-8", |
| 1172 }; | 1227 }; |
| 1173 var resp = convert.JSON.encode(buildInsert2()); | 1228 var resp = convert.JSON.encode(buildInsert2()); |
| 1174 return new async.Future.value(stringResponse(200, h, resp)); | 1229 return new async.Future.value(stringResponse(200, h, resp)); |
| 1175 }), true); | 1230 }), true); |
| 1176 res.insert(arg_request, arg_project).then(unittest.expectAsync1(((api.Inse
rt2 response) { | 1231 res |
| 1232 .insert(arg_request, arg_project) |
| 1233 .then(unittest.expectAsync1(((api.Insert2 response) { |
| 1177 checkInsert2(response); | 1234 checkInsert2(response); |
| 1178 }))); | 1235 }))); |
| 1179 }); | 1236 }); |
| 1180 | 1237 |
| 1181 unittest.test("method--list", () { | 1238 unittest.test("method--list", () { |
| 1182 | |
| 1183 var mock = new HttpServerMock(); | 1239 var mock = new HttpServerMock(); |
| 1184 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1240 api.TrainedmodelsResourceApi res = |
| 1241 new api.PredictionApi(mock).trainedmodels; |
| 1185 var arg_project = "foo"; | 1242 var arg_project = "foo"; |
| 1186 var arg_maxResults = 42; | 1243 var arg_maxResults = 42; |
| 1187 var arg_pageToken = "foo"; | 1244 var arg_pageToken = "foo"; |
| 1188 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1245 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1189 var path = (req.url).path; | 1246 var path = (req.url).path; |
| 1190 var pathOffset = 0; | 1247 var pathOffset = 0; |
| 1191 var index; | 1248 var index; |
| 1192 var subPart; | 1249 var subPart; |
| 1193 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1250 unittest.expect( |
| 1251 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1194 pathOffset += 1; | 1252 pathOffset += 1; |
| 1195 | 1253 |
| 1196 var query = (req.url).query; | 1254 var query = (req.url).query; |
| 1197 var queryOffset = 0; | 1255 var queryOffset = 0; |
| 1198 var queryMap = {}; | 1256 var queryMap = {}; |
| 1199 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1257 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1200 parseBool(n) { | 1258 parseBool(n) { |
| 1201 if (n == "true") return true; | 1259 if (n == "true") return true; |
| 1202 if (n == "false") return false; | 1260 if (n == "false") return false; |
| 1203 if (n == null) return null; | 1261 if (n == null) return null; |
| 1204 throw new core.ArgumentError("Invalid boolean: $n"); | 1262 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1205 } | 1263 } |
| 1264 |
| 1206 if (query.length > 0) { | 1265 if (query.length > 0) { |
| 1207 for (var part in query.split("&")) { | 1266 for (var part in query.split("&")) { |
| 1208 var keyvalue = part.split("="); | 1267 var keyvalue = part.split("="); |
| 1209 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1268 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1269 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1210 } | 1270 } |
| 1211 } | 1271 } |
| 1212 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); | 1272 unittest.expect(core.int.parse(queryMap["maxResults"].first), |
| 1213 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 1273 unittest.equals(arg_maxResults)); |
| 1214 | 1274 unittest.expect( |
| 1275 queryMap["pageToken"].first, unittest.equals(arg_pageToken)); |
| 1215 | 1276 |
| 1216 var h = { | 1277 var h = { |
| 1217 "content-type" : "application/json; charset=utf-8", | 1278 "content-type": "application/json; charset=utf-8", |
| 1218 }; | 1279 }; |
| 1219 var resp = convert.JSON.encode(buildList()); | 1280 var resp = convert.JSON.encode(buildList()); |
| 1220 return new async.Future.value(stringResponse(200, h, resp)); | 1281 return new async.Future.value(stringResponse(200, h, resp)); |
| 1221 }), true); | 1282 }), true); |
| 1222 res.list(arg_project, maxResults: arg_maxResults, pageToken: arg_pageToken
).then(unittest.expectAsync1(((api.List response) { | 1283 res |
| 1284 .list(arg_project, |
| 1285 maxResults: arg_maxResults, pageToken: arg_pageToken) |
| 1286 .then(unittest.expectAsync1(((api.List response) { |
| 1223 checkList(response); | 1287 checkList(response); |
| 1224 }))); | 1288 }))); |
| 1225 }); | 1289 }); |
| 1226 | 1290 |
| 1227 unittest.test("method--predict", () { | 1291 unittest.test("method--predict", () { |
| 1228 | |
| 1229 var mock = new HttpServerMock(); | 1292 var mock = new HttpServerMock(); |
| 1230 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1293 api.TrainedmodelsResourceApi res = |
| 1294 new api.PredictionApi(mock).trainedmodels; |
| 1231 var arg_request = buildInput(); | 1295 var arg_request = buildInput(); |
| 1232 var arg_project = "foo"; | 1296 var arg_project = "foo"; |
| 1233 var arg_id = "foo"; | 1297 var arg_id = "foo"; |
| 1234 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1298 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1235 var obj = new api.Input.fromJson(json); | 1299 var obj = new api.Input.fromJson(json); |
| 1236 checkInput(obj); | 1300 checkInput(obj); |
| 1237 | 1301 |
| 1238 var path = (req.url).path; | 1302 var path = (req.url).path; |
| 1239 var pathOffset = 0; | 1303 var pathOffset = 0; |
| 1240 var index; | 1304 var index; |
| 1241 var subPart; | 1305 var subPart; |
| 1242 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1306 unittest.expect( |
| 1307 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1243 pathOffset += 1; | 1308 pathOffset += 1; |
| 1244 | 1309 |
| 1245 var query = (req.url).query; | 1310 var query = (req.url).query; |
| 1246 var queryOffset = 0; | 1311 var queryOffset = 0; |
| 1247 var queryMap = {}; | 1312 var queryMap = {}; |
| 1248 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1313 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1249 parseBool(n) { | 1314 parseBool(n) { |
| 1250 if (n == "true") return true; | 1315 if (n == "true") return true; |
| 1251 if (n == "false") return false; | 1316 if (n == "false") return false; |
| 1252 if (n == null) return null; | 1317 if (n == null) return null; |
| 1253 throw new core.ArgumentError("Invalid boolean: $n"); | 1318 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1254 } | 1319 } |
| 1320 |
| 1255 if (query.length > 0) { | 1321 if (query.length > 0) { |
| 1256 for (var part in query.split("&")) { | 1322 for (var part in query.split("&")) { |
| 1257 var keyvalue = part.split("="); | 1323 var keyvalue = part.split("="); |
| 1258 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1324 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1325 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1259 } | 1326 } |
| 1260 } | 1327 } |
| 1261 | 1328 |
| 1262 | |
| 1263 var h = { | 1329 var h = { |
| 1264 "content-type" : "application/json; charset=utf-8", | 1330 "content-type": "application/json; charset=utf-8", |
| 1265 }; | 1331 }; |
| 1266 var resp = convert.JSON.encode(buildOutput()); | 1332 var resp = convert.JSON.encode(buildOutput()); |
| 1267 return new async.Future.value(stringResponse(200, h, resp)); | 1333 return new async.Future.value(stringResponse(200, h, resp)); |
| 1268 }), true); | 1334 }), true); |
| 1269 res.predict(arg_request, arg_project, arg_id).then(unittest.expectAsync1((
(api.Output response) { | 1335 res |
| 1336 .predict(arg_request, arg_project, arg_id) |
| 1337 .then(unittest.expectAsync1(((api.Output response) { |
| 1270 checkOutput(response); | 1338 checkOutput(response); |
| 1271 }))); | 1339 }))); |
| 1272 }); | 1340 }); |
| 1273 | 1341 |
| 1274 unittest.test("method--update", () { | 1342 unittest.test("method--update", () { |
| 1275 | |
| 1276 var mock = new HttpServerMock(); | 1343 var mock = new HttpServerMock(); |
| 1277 api.TrainedmodelsResourceApi res = new api.PredictionApi(mock).trainedmode
ls; | 1344 api.TrainedmodelsResourceApi res = |
| 1345 new api.PredictionApi(mock).trainedmodels; |
| 1278 var arg_request = buildUpdate(); | 1346 var arg_request = buildUpdate(); |
| 1279 var arg_project = "foo"; | 1347 var arg_project = "foo"; |
| 1280 var arg_id = "foo"; | 1348 var arg_id = "foo"; |
| 1281 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { | 1349 mock.register(unittest.expectAsync2((http.BaseRequest req, json) { |
| 1282 var obj = new api.Update.fromJson(json); | 1350 var obj = new api.Update.fromJson(json); |
| 1283 checkUpdate(obj); | 1351 checkUpdate(obj); |
| 1284 | 1352 |
| 1285 var path = (req.url).path; | 1353 var path = (req.url).path; |
| 1286 var pathOffset = 0; | 1354 var pathOffset = 0; |
| 1287 var index; | 1355 var index; |
| 1288 var subPart; | 1356 var subPart; |
| 1289 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1357 unittest.expect( |
| 1358 path.substring(pathOffset, pathOffset + 1), unittest.equals("/")); |
| 1290 pathOffset += 1; | 1359 pathOffset += 1; |
| 1291 | 1360 |
| 1292 var query = (req.url).query; | 1361 var query = (req.url).query; |
| 1293 var queryOffset = 0; | 1362 var queryOffset = 0; |
| 1294 var queryMap = {}; | 1363 var queryMap = {}; |
| 1295 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1364 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1296 parseBool(n) { | 1365 parseBool(n) { |
| 1297 if (n == "true") return true; | 1366 if (n == "true") return true; |
| 1298 if (n == "false") return false; | 1367 if (n == "false") return false; |
| 1299 if (n == null) return null; | 1368 if (n == null) return null; |
| 1300 throw new core.ArgumentError("Invalid boolean: $n"); | 1369 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1301 } | 1370 } |
| 1371 |
| 1302 if (query.length > 0) { | 1372 if (query.length > 0) { |
| 1303 for (var part in query.split("&")) { | 1373 for (var part in query.split("&")) { |
| 1304 var keyvalue = part.split("="); | 1374 var keyvalue = part.split("="); |
| 1305 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1375 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), |
| 1376 core.Uri.decodeQueryComponent(keyvalue[1])); |
| 1306 } | 1377 } |
| 1307 } | 1378 } |
| 1308 | 1379 |
| 1309 | |
| 1310 var h = { | 1380 var h = { |
| 1311 "content-type" : "application/json; charset=utf-8", | 1381 "content-type": "application/json; charset=utf-8", |
| 1312 }; | 1382 }; |
| 1313 var resp = convert.JSON.encode(buildInsert2()); | 1383 var resp = convert.JSON.encode(buildInsert2()); |
| 1314 return new async.Future.value(stringResponse(200, h, resp)); | 1384 return new async.Future.value(stringResponse(200, h, resp)); |
| 1315 }), true); | 1385 }), true); |
| 1316 res.update(arg_request, arg_project, arg_id).then(unittest.expectAsync1(((
api.Insert2 response) { | 1386 res |
| 1387 .update(arg_request, arg_project, arg_id) |
| 1388 .then(unittest.expectAsync1(((api.Insert2 response) { |
| 1317 checkInsert2(response); | 1389 checkInsert2(response); |
| 1318 }))); | 1390 }))); |
| 1319 }); | 1391 }); |
| 1320 | |
| 1321 }); | 1392 }); |
| 1322 | |
| 1323 | |
| 1324 } | 1393 } |
| 1325 | |
| OLD | NEW |