| 1 | // Code generated by gen_tests.py and process_polyglot.py. |
| 2 | // Do not edit this file directly. |
| 3 | // The template for this file is located at: |
| 4 | // ../template.go.tpl |
| 5 | package reql_tests |
| 6 | |
| 7 | import ( |
| 8 | "testing" |
| 9 | "time" |
| 10 | |
| 11 | "github.com/stretchr/testify/suite" |
| 12 | r "gopkg.in/rethinkdb/rethinkdb-go.v6" |
| 13 | "gopkg.in/rethinkdb/rethinkdb-go.v6/internal/compare" |
| 14 | ) |
| 15 | |
| 16 | // Test point changebasics |
| 17 | func TestChangefeedsPointSuite(t *testing.T) { |
| 18 | suite.Run(t, new(ChangefeedsPointSuite)) |
| 19 | } |
| 20 | |
| 21 | type ChangefeedsPointSuite struct { |
| 22 | suite.Suite |
| 23 | |
| 24 | session *r.Session |
| 25 | } |
| 26 | |
| 27 | func (suite *ChangefeedsPointSuite) SetupTest() { |
| 28 | suite.T().Log("Setting up ChangefeedsPointSuite") |
| 29 | // Use imports to prevent errors |
| 30 | _ = time.Time{} |
| 31 | _ = compare.AnythingIsFine |
| 32 | |
| 33 | session, err := r.Connect(r.ConnectOpts{ |
| 34 | Address: url, |
| 35 | }) |
| 36 | suite.Require().NoError(err, "Error returned when connecting to server") |
| 37 | suite.session = session |
| 38 | |
| 39 | r.DBDrop("db_feed_point").Exec(suite.session) |
| 40 | err = r.DBCreate("db_feed_point").Exec(suite.session) |
| 41 | suite.Require().NoError(err) |
| 42 | err = r.DB("db_feed_point").Wait().Exec(suite.session) |
| 43 | suite.Require().NoError(err) |
| 44 | |
| 45 | r.DB("db_feed_point").TableDrop("table_test_changefeed_point").Exec(suite.session) |
| 46 | err = r.DB("db_feed_point").TableCreate("table_test_changefeed_point").Exec(suite.session) |
| 47 | suite.Require().NoError(err) |
| 48 | err = r.DB("db_feed_point").Table("table_test_changefeed_point").Wait().Exec(suite.session) |
| 49 | suite.Require().NoError(err) |
| 50 | } |
| 51 | |
| 52 | func (suite *ChangefeedsPointSuite) TearDownSuite() { |
| 53 | suite.T().Log("Tearing down ChangefeedsPointSuite") |
| 54 | |
| 55 | if suite.session != nil { |
| 56 | r.DB("rethinkdb").Table("_debug_scratch").Delete().Exec(suite.session) |
| 57 | r.DB("db_feed_point").TableDrop("table_test_changefeed_point").Exec(suite.session) |
| 58 | r.DBDrop("db_feed_point").Exec(suite.session) |
| 59 | |
| 60 | suite.session.Close() |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func (suite *ChangefeedsPointSuite) TestCases() { |
| 65 | suite.T().Log("Running ChangefeedsPointSuite: Test point changebasics") |
| 66 | |
| 67 | table_test_changefeed_point := r.DB("db_feed_point").Table("table_test_changefeed_point") |
| 68 | _ = table_test_changefeed_point // Prevent any noused variable errors |
| 69 | |
| 70 | // changefeeds/point.yaml line #10 |
| 71 | // basic = table_test_changefeed_point.get(1).changes(include_initial=True) |
| 72 | suite.T().Log("Possibly executing: var basic r.Term = table_test_changefeed_point.Get(1).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true, })") |
| 73 | |
| 74 | basic := maybeRun(table_test_changefeed_point.Get(1).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true}), suite.session, r.RunOpts{}) |
| 75 | _ = basic // Prevent any noused variable errors |
| 76 | |
| 77 | { |
| 78 | // changefeeds/point.yaml line #14 |
| 79 | /* [{'new_val':null}] */ |
| 80 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"new_val": nil}} |
| 81 | /* fetch(basic, 1) */ |
| 82 | |
| 83 | suite.T().Log("About to run line #14: fetch(basic, 1)") |
| 84 | |
| 85 | fetchAndAssert(suite.Suite, expected_, basic, 1) |
| 86 | suite.T().Log("Finished running line #14") |
| 87 | } |
| 88 | |
| 89 | { |
| 90 | // changefeeds/point.yaml line #19 |
| 91 | /* partial({'errors':0, 'inserted':1}) */ |
| 92 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "inserted": 1}) |
| 93 | /* table_test_changefeed_point.insert({'id':1}) */ |
| 94 | |
| 95 | suite.T().Log("About to run line #19: table_test_changefeed_point.Insert(map[interface{}]interface{}{'id': 1, })") |
| 96 | |
| 97 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Insert(map[interface{}]interface{}{"id": 1}), suite.session, r.RunOpts{ |
| 98 | GeometryFormat: "raw", |
| 99 | GroupFormat: "map", |
| 100 | }) |
| 101 | suite.T().Log("Finished running line #19") |
| 102 | } |
| 103 | |
| 104 | { |
| 105 | // changefeeds/point.yaml line #22 |
| 106 | /* [{'old_val':null, 'new_val':{'id':1}}] */ |
| 107 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"old_val": nil, "new_val": map[interface{}]interface{}{"id": 1}}} |
| 108 | /* fetch(basic, 1) */ |
| 109 | |
| 110 | suite.T().Log("About to run line #22: fetch(basic, 1)") |
| 111 | |
| 112 | fetchAndAssert(suite.Suite, expected_, basic, 1) |
| 113 | suite.T().Log("Finished running line #22") |
| 114 | } |
| 115 | |
| 116 | { |
| 117 | // changefeeds/point.yaml line #27 |
| 118 | /* partial({'errors':0, 'replaced':1}) */ |
| 119 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "replaced": 1}) |
| 120 | /* table_test_changefeed_point.get(1).update({'update':1}) */ |
| 121 | |
| 122 | suite.T().Log("About to run line #27: table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{'update': 1, })") |
| 123 | |
| 124 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{"update": 1}), suite.session, r.RunOpts{ |
| 125 | GeometryFormat: "raw", |
| 126 | GroupFormat: "map", |
| 127 | }) |
| 128 | suite.T().Log("Finished running line #27") |
| 129 | } |
| 130 | |
| 131 | { |
| 132 | // changefeeds/point.yaml line #30 |
| 133 | /* [{'old_val':{'id':1}, 'new_val':{'id':1,'update':1}}] */ |
| 134 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"old_val": map[interface{}]interface{}{"id": 1}, "new_val": map[interface{}]interface{}{"id": 1, "update": 1}}} |
| 135 | /* fetch(basic, 1) */ |
| 136 | |
| 137 | suite.T().Log("About to run line #30: fetch(basic, 1)") |
| 138 | |
| 139 | fetchAndAssert(suite.Suite, expected_, basic, 1) |
| 140 | suite.T().Log("Finished running line #30") |
| 141 | } |
| 142 | |
| 143 | { |
| 144 | // changefeeds/point.yaml line #35 |
| 145 | /* partial({'errors':0, 'deleted':1}) */ |
| 146 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "deleted": 1}) |
| 147 | /* table_test_changefeed_point.get(1).delete() */ |
| 148 | |
| 149 | suite.T().Log("About to run line #35: table_test_changefeed_point.Get(1).Delete()") |
| 150 | |
| 151 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(1).Delete(), suite.session, r.RunOpts{ |
| 152 | GeometryFormat: "raw", |
| 153 | GroupFormat: "map", |
| 154 | }) |
| 155 | suite.T().Log("Finished running line #35") |
| 156 | } |
| 157 | |
| 158 | { |
| 159 | // changefeeds/point.yaml line #38 |
| 160 | /* [{'old_val':{'id':1,'update':1}, 'new_val':null}] */ |
| 161 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"old_val": map[interface{}]interface{}{"id": 1, "update": 1}, "new_val": nil}} |
| 162 | /* fetch(basic, 1) */ |
| 163 | |
| 164 | suite.T().Log("About to run line #38: fetch(basic, 1)") |
| 165 | |
| 166 | fetchAndAssert(suite.Suite, expected_, basic, 1) |
| 167 | suite.T().Log("Finished running line #38") |
| 168 | } |
| 169 | |
| 170 | // changefeeds/point.yaml line #49 |
| 171 | // filter = table_test_changefeed_point.get(1).changes(squash=false,include_initial=True).filter(r.row['new_val']['update'].gt(2))['new_val']['update'] |
| 172 | suite.T().Log("Possibly executing: var filter r.Term = table_test_changefeed_point.Get(1).Changes().OptArgs(r.ChangesOpts{Squash: false, IncludeInitial: true, }).Filter(r.Row.AtIndex('new_val').AtIndex('update').Gt(2)).AtIndex('new_val').AtIndex('update')") |
| 173 | |
| 174 | filter := maybeRun(table_test_changefeed_point.Get(1).Changes().OptArgs(r.ChangesOpts{Squash: false, IncludeInitial: true}).Filter(r.Row.AtIndex("new_val").AtIndex("update").Gt(2)).AtIndex("new_val").AtIndex("update"), suite.session, r.RunOpts{}) |
| 175 | _ = filter // Prevent any noused variable errors |
| 176 | |
| 177 | { |
| 178 | // changefeeds/point.yaml line #53 |
| 179 | /* AnythingIsFine */ |
| 180 | var expected_ string = compare.AnythingIsFine |
| 181 | /* table_test_changefeed_point.insert({'id':1, 'update':1}) */ |
| 182 | |
| 183 | suite.T().Log("About to run line #53: table_test_changefeed_point.Insert(map[interface{}]interface{}{'id': 1, 'update': 1, })") |
| 184 | |
| 185 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Insert(map[interface{}]interface{}{"id": 1, "update": 1}), suite.session, r.RunOpts{ |
| 186 | GeometryFormat: "raw", |
| 187 | GroupFormat: "map", |
| 188 | }) |
| 189 | suite.T().Log("Finished running line #53") |
| 190 | } |
| 191 | |
| 192 | { |
| 193 | // changefeeds/point.yaml line #54 |
| 194 | /* AnythingIsFine */ |
| 195 | var expected_ string = compare.AnythingIsFine |
| 196 | /* table_test_changefeed_point.get(1).update({'update':4}) */ |
| 197 | |
| 198 | suite.T().Log("About to run line #54: table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{'update': 4, })") |
| 199 | |
| 200 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{"update": 4}), suite.session, r.RunOpts{ |
| 201 | GeometryFormat: "raw", |
| 202 | GroupFormat: "map", |
| 203 | }) |
| 204 | suite.T().Log("Finished running line #54") |
| 205 | } |
| 206 | |
| 207 | { |
| 208 | // changefeeds/point.yaml line #55 |
| 209 | /* AnythingIsFine */ |
| 210 | var expected_ string = compare.AnythingIsFine |
| 211 | /* table_test_changefeed_point.get(1).update({'update':1}) */ |
| 212 | |
| 213 | suite.T().Log("About to run line #55: table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{'update': 1, })") |
| 214 | |
| 215 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{"update": 1}), suite.session, r.RunOpts{ |
| 216 | GeometryFormat: "raw", |
| 217 | GroupFormat: "map", |
| 218 | }) |
| 219 | suite.T().Log("Finished running line #55") |
| 220 | } |
| 221 | |
| 222 | { |
| 223 | // changefeeds/point.yaml line #56 |
| 224 | /* AnythingIsFine */ |
| 225 | var expected_ string = compare.AnythingIsFine |
| 226 | /* table_test_changefeed_point.get(1).update({'update':7}) */ |
| 227 | |
| 228 | suite.T().Log("About to run line #56: table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{'update': 7, })") |
| 229 | |
| 230 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{"update": 7}), suite.session, r.RunOpts{ |
| 231 | GeometryFormat: "raw", |
| 232 | GroupFormat: "map", |
| 233 | }) |
| 234 | suite.T().Log("Finished running line #56") |
| 235 | } |
| 236 | |
| 237 | { |
| 238 | // changefeeds/point.yaml line #58 |
| 239 | /* [4,7] */ |
| 240 | var expected_ []interface{} = []interface{}{4, 7} |
| 241 | /* fetch(filter, 2) */ |
| 242 | |
| 243 | suite.T().Log("About to run line #58: fetch(filter, 2)") |
| 244 | |
| 245 | fetchAndAssert(suite.Suite, expected_, filter, 2) |
| 246 | suite.T().Log("Finished running line #58") |
| 247 | } |
| 248 | |
| 249 | // changefeeds/point.yaml line #63 |
| 250 | // pluck = table_test_changefeed_point.get(3).changes(squash=false,include_initial=True).pluck({'new_val':['red', 'blue']})['new_val'] |
| 251 | suite.T().Log("Possibly executing: var pluck r.Term = table_test_changefeed_point.Get(3).Changes().OptArgs(r.ChangesOpts{Squash: false, IncludeInitial: true, }).Pluck(map[interface{}]interface{}{'new_val': []interface{}{'red', 'blue'}, }).AtIndex('new_val')") |
| 252 | |
| 253 | pluck := maybeRun(table_test_changefeed_point.Get(3).Changes().OptArgs(r.ChangesOpts{Squash: false, IncludeInitial: true}).Pluck(map[interface{}]interface{}{"new_val": []interface{}{"red", "blue"}}).AtIndex("new_val"), suite.session, r.RunOpts{}) |
| 254 | _ = pluck // Prevent any noused variable errors |
| 255 | |
| 256 | { |
| 257 | // changefeeds/point.yaml line #67 |
| 258 | /* partial({'errors':0, 'inserted':1}) */ |
| 259 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "inserted": 1}) |
| 260 | /* table_test_changefeed_point.insert({'id':3, 'red':1, 'green':1}) */ |
| 261 | |
| 262 | suite.T().Log("About to run line #67: table_test_changefeed_point.Insert(map[interface{}]interface{}{'id': 3, 'red': 1, 'green': 1, })") |
| 263 | |
| 264 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Insert(map[interface{}]interface{}{"id": 3, "red": 1, "green": 1}), suite.session, r.RunOpts{ |
| 265 | GeometryFormat: "raw", |
| 266 | GroupFormat: "map", |
| 267 | }) |
| 268 | suite.T().Log("Finished running line #67") |
| 269 | } |
| 270 | |
| 271 | { |
| 272 | // changefeeds/point.yaml line #69 |
| 273 | /* partial({'errors':0, 'replaced':1}) */ |
| 274 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "replaced": 1}) |
| 275 | /* table_test_changefeed_point.get(3).update({'blue':2, 'green':3}) */ |
| 276 | |
| 277 | suite.T().Log("About to run line #69: table_test_changefeed_point.Get(3).Update(map[interface{}]interface{}{'blue': 2, 'green': 3, })") |
| 278 | |
| 279 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(3).Update(map[interface{}]interface{}{"blue": 2, "green": 3}), suite.session, r.RunOpts{ |
| 280 | GeometryFormat: "raw", |
| 281 | GroupFormat: "map", |
| 282 | }) |
| 283 | suite.T().Log("Finished running line #69") |
| 284 | } |
| 285 | |
| 286 | { |
| 287 | // changefeeds/point.yaml line #71 |
| 288 | /* partial({'errors':0, 'replaced':1}) */ |
| 289 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "replaced": 1}) |
| 290 | /* table_test_changefeed_point.get(3).update({'green':4}) */ |
| 291 | |
| 292 | suite.T().Log("About to run line #71: table_test_changefeed_point.Get(3).Update(map[interface{}]interface{}{'green': 4, })") |
| 293 | |
| 294 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(3).Update(map[interface{}]interface{}{"green": 4}), suite.session, r.RunOpts{ |
| 295 | GeometryFormat: "raw", |
| 296 | GroupFormat: "map", |
| 297 | }) |
| 298 | suite.T().Log("Finished running line #71") |
| 299 | } |
| 300 | |
| 301 | { |
| 302 | // changefeeds/point.yaml line #73 |
| 303 | /* partial({'errors':0, 'replaced':1}) */ |
| 304 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "replaced": 1}) |
| 305 | /* table_test_changefeed_point.get(3).update({'blue':4}) */ |
| 306 | |
| 307 | suite.T().Log("About to run line #73: table_test_changefeed_point.Get(3).Update(map[interface{}]interface{}{'blue': 4, })") |
| 308 | |
| 309 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Get(3).Update(map[interface{}]interface{}{"blue": 4}), suite.session, r.RunOpts{ |
| 310 | GeometryFormat: "raw", |
| 311 | GroupFormat: "map", |
| 312 | }) |
| 313 | suite.T().Log("Finished running line #73") |
| 314 | } |
| 315 | |
| 316 | { |
| 317 | // changefeeds/point.yaml line #76 |
| 318 | /* [{'red': 1}, {'blue': 2, 'red': 1}, {'blue': 2, 'red': 1}, {'blue': 4, 'red': 1}] */ |
| 319 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"red": 1}, map[interface{}]interface{}{"blue": 2, "red": 1}, map[interface{}]interface{}{"blue": 2, "red": 1}, map[interface{}]interface{}{"blue": 4, "red": 1}} |
| 320 | /* fetch(pluck, 4) */ |
| 321 | |
| 322 | suite.T().Log("About to run line #76: fetch(pluck, 4)") |
| 323 | |
| 324 | fetchAndAssert(suite.Suite, expected_, pluck, 4) |
| 325 | suite.T().Log("Finished running line #76") |
| 326 | } |
| 327 | |
| 328 | // changefeeds/point.yaml line #83 |
| 329 | // dtable_test_changefeed_point = r.db('rethinkdb').table('_debug_scratch') |
| 330 | suite.T().Log("Possibly executing: var dtable_test_changefeed_point r.Term = r.DB('rethinkdb').Table('_debug_scratch')") |
| 331 | |
| 332 | dtable_test_changefeed_point := r.DB("rethinkdb").Table("_debug_scratch") |
| 333 | _ = dtable_test_changefeed_point // Prevent any noused variable errors |
| 334 | |
| 335 | // changefeeds/point.yaml line #86 |
| 336 | // debug = dtable_test_changefeed_point.get(1).changes(include_initial=True) |
| 337 | suite.T().Log("Possibly executing: var debug r.Term = dtable_test_changefeed_point.Get(1).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true, })") |
| 338 | |
| 339 | debug := maybeRun(dtable_test_changefeed_point.Get(1).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true}), suite.session, r.RunOpts{}) |
| 340 | _ = debug // Prevent any noused variable errors |
| 341 | |
| 342 | { |
| 343 | // changefeeds/point.yaml line #88 |
| 344 | /* [{'new_val':null}] */ |
| 345 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"new_val": nil}} |
| 346 | /* fetch(debug, 1) */ |
| 347 | |
| 348 | suite.T().Log("About to run line #88: fetch(debug, 1)") |
| 349 | |
| 350 | fetchAndAssert(suite.Suite, expected_, debug, 1) |
| 351 | suite.T().Log("Finished running line #88") |
| 352 | } |
| 353 | |
| 354 | { |
| 355 | // changefeeds/point.yaml line #91 |
| 356 | /* partial({'errors':0, 'inserted':1}) */ |
| 357 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "inserted": 1}) |
| 358 | /* dtable_test_changefeed_point.insert({'id':1}) */ |
| 359 | |
| 360 | suite.T().Log("About to run line #91: dtable_test_changefeed_point.Insert(map[interface{}]interface{}{'id': 1, })") |
| 361 | |
| 362 | runAndAssert(suite.Suite, expected_, dtable_test_changefeed_point.Insert(map[interface{}]interface{}{"id": 1}), suite.session, r.RunOpts{ |
| 363 | GeometryFormat: "raw", |
| 364 | GroupFormat: "map", |
| 365 | }) |
| 366 | suite.T().Log("Finished running line #91") |
| 367 | } |
| 368 | |
| 369 | { |
| 370 | // changefeeds/point.yaml line #93 |
| 371 | /* [{'old_val':null, 'new_val':{'id':1}}] */ |
| 372 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"old_val": nil, "new_val": map[interface{}]interface{}{"id": 1}}} |
| 373 | /* fetch(debug, 1) */ |
| 374 | |
| 375 | suite.T().Log("About to run line #93: fetch(debug, 1)") |
| 376 | |
| 377 | fetchAndAssert(suite.Suite, expected_, debug, 1) |
| 378 | suite.T().Log("Finished running line #93") |
| 379 | } |
| 380 | |
| 381 | { |
| 382 | // changefeeds/point.yaml line #96 |
| 383 | /* partial({'errors':0, 'replaced':1}) */ |
| 384 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "replaced": 1}) |
| 385 | /* dtable_test_changefeed_point.get(1).update({'update':1}) */ |
| 386 | |
| 387 | suite.T().Log("About to run line #96: dtable_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{'update': 1, })") |
| 388 | |
| 389 | runAndAssert(suite.Suite, expected_, dtable_test_changefeed_point.Get(1).Update(map[interface{}]interface{}{"update": 1}), suite.session, r.RunOpts{ |
| 390 | GeometryFormat: "raw", |
| 391 | GroupFormat: "map", |
| 392 | }) |
| 393 | suite.T().Log("Finished running line #96") |
| 394 | } |
| 395 | |
| 396 | { |
| 397 | // changefeeds/point.yaml line #98 |
| 398 | /* [{'old_val':{'id':1}, 'new_val':{'id':1,'update':1}}] */ |
| 399 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"old_val": map[interface{}]interface{}{"id": 1}, "new_val": map[interface{}]interface{}{"id": 1, "update": 1}}} |
| 400 | /* fetch(debug, 1) */ |
| 401 | |
| 402 | suite.T().Log("About to run line #98: fetch(debug, 1)") |
| 403 | |
| 404 | fetchAndAssert(suite.Suite, expected_, debug, 1) |
| 405 | suite.T().Log("Finished running line #98") |
| 406 | } |
| 407 | |
| 408 | { |
| 409 | // changefeeds/point.yaml line #101 |
| 410 | /* partial({'errors':0, 'deleted':1}) */ |
| 411 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "deleted": 1}) |
| 412 | /* dtable_test_changefeed_point.get(1).delete() */ |
| 413 | |
| 414 | suite.T().Log("About to run line #101: dtable_test_changefeed_point.Get(1).Delete()") |
| 415 | |
| 416 | runAndAssert(suite.Suite, expected_, dtable_test_changefeed_point.Get(1).Delete(), suite.session, r.RunOpts{ |
| 417 | GeometryFormat: "raw", |
| 418 | GroupFormat: "map", |
| 419 | }) |
| 420 | suite.T().Log("Finished running line #101") |
| 421 | } |
| 422 | |
| 423 | { |
| 424 | // changefeeds/point.yaml line #103 |
| 425 | /* [{'old_val':{'id':1,'update':1}, 'new_val':null}] */ |
| 426 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"old_val": map[interface{}]interface{}{"id": 1, "update": 1}, "new_val": nil}} |
| 427 | /* fetch(debug, 1) */ |
| 428 | |
| 429 | suite.T().Log("About to run line #103: fetch(debug, 1)") |
| 430 | |
| 431 | fetchAndAssert(suite.Suite, expected_, debug, 1) |
| 432 | suite.T().Log("Finished running line #103") |
| 433 | } |
| 434 | |
| 435 | { |
| 436 | // changefeeds/point.yaml line #106 |
| 437 | /* {'skipped':0, 'deleted':0, 'unchanged':0, 'errors':0, 'replaced':0, 'inserted':1} */ |
| 438 | var expected_ map[interface{}]interface{} = map[interface{}]interface{}{"skipped": 0, "deleted": 0, "unchanged": 0, "errors": 0, "replaced": 0, "inserted": 1} |
| 439 | /* dtable_test_changefeed_point.insert({'id':5, 'red':1, 'green':1}) */ |
| 440 | |
| 441 | suite.T().Log("About to run line #106: dtable_test_changefeed_point.Insert(map[interface{}]interface{}{'id': 5, 'red': 1, 'green': 1, })") |
| 442 | |
| 443 | runAndAssert(suite.Suite, expected_, dtable_test_changefeed_point.Insert(map[interface{}]interface{}{"id": 5, "red": 1, "green": 1}), suite.session, r.RunOpts{ |
| 444 | GeometryFormat: "raw", |
| 445 | GroupFormat: "map", |
| 446 | }) |
| 447 | suite.T().Log("Finished running line #106") |
| 448 | } |
| 449 | |
| 450 | // changefeeds/point.yaml line #108 |
| 451 | // dtable_test_changefeed_pointPluck = dtable_test_changefeed_point.get(5).changes(include_initial=True).pluck({'new_val':['red', 'blue']})['new_val'] |
| 452 | suite.T().Log("Possibly executing: var dtable_test_changefeed_pointPluck r.Term = dtable_test_changefeed_point.Get(5).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true, }).Pluck(map[interface{}]interface{}{'new_val': []interface{}{'red', 'blue'}, }).AtIndex('new_val')") |
| 453 | |
| 454 | dtable_test_changefeed_pointPluck := maybeRun(dtable_test_changefeed_point.Get(5).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true}).Pluck(map[interface{}]interface{}{"new_val": []interface{}{"red", "blue"}}).AtIndex("new_val"), suite.session, r.RunOpts{}) |
| 455 | _ = dtable_test_changefeed_pointPluck // Prevent any noused variable errors |
| 456 | |
| 457 | { |
| 458 | // changefeeds/point.yaml line #113 |
| 459 | /* [{'red':1}] */ |
| 460 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"red": 1}} |
| 461 | /* fetch(dtable_test_changefeed_pointPluck, 1) */ |
| 462 | |
| 463 | suite.T().Log("About to run line #113: fetch(dtable_test_changefeed_pointPluck, 1)") |
| 464 | |
| 465 | fetchAndAssert(suite.Suite, expected_, dtable_test_changefeed_pointPluck, 1) |
| 466 | suite.T().Log("Finished running line #113") |
| 467 | } |
| 468 | |
| 469 | { |
| 470 | // changefeeds/point.yaml line #116 |
| 471 | /* partial({'errors':0, 'replaced':1}) */ |
| 472 | var expected_ compare.Expected = compare.PartialMatch(map[interface{}]interface{}{"errors": 0, "replaced": 1}) |
| 473 | /* dtable_test_changefeed_point.get(5).update({'blue':2, 'green':3}) */ |
| 474 | |
| 475 | suite.T().Log("About to run line #116: dtable_test_changefeed_point.Get(5).Update(map[interface{}]interface{}{'blue': 2, 'green': 3, })") |
| 476 | |
| 477 | runAndAssert(suite.Suite, expected_, dtable_test_changefeed_point.Get(5).Update(map[interface{}]interface{}{"blue": 2, "green": 3}), suite.session, r.RunOpts{ |
| 478 | GeometryFormat: "raw", |
| 479 | GroupFormat: "map", |
| 480 | }) |
| 481 | suite.T().Log("Finished running line #116") |
| 482 | } |
| 483 | |
| 484 | { |
| 485 | // changefeeds/point.yaml line #119 |
| 486 | /* [{'blue':2, 'red':1}] */ |
| 487 | var expected_ []interface{} = []interface{}{map[interface{}]interface{}{"blue": 2, "red": 1}} |
| 488 | /* fetch(dtable_test_changefeed_pointPluck, 1) */ |
| 489 | |
| 490 | suite.T().Log("About to run line #119: fetch(dtable_test_changefeed_pointPluck, 1)") |
| 491 | |
| 492 | fetchAndAssert(suite.Suite, expected_, dtable_test_changefeed_pointPluck, 1) |
| 493 | suite.T().Log("Finished running line #119") |
| 494 | } |
| 495 | |
| 496 | // changefeeds/point.yaml line #132 |
| 497 | // tableId = table_test_changefeed_point.info()['id'] |
| 498 | suite.T().Log("Possibly executing: var tableId r.Term = table_test_changefeed_point.Info().AtIndex('id')") |
| 499 | |
| 500 | tableId := maybeRun(table_test_changefeed_point.Info().AtIndex("id"), suite.session, r.RunOpts{}) |
| 501 | _ = tableId // Prevent any noused variable errors |
| 502 | |
| 503 | // changefeeds/point.yaml line #136 |
| 504 | // rtblPluck = r.db('rethinkdb').table('table_status').get(tableId).changes(include_initial=True) |
| 505 | suite.T().Log("Possibly executing: var rtblPluck r.Term = r.DB('rethinkdb').Table('table_status').Get(tableId).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true, })") |
| 506 | |
| 507 | rtblPluck := maybeRun(r.DB("rethinkdb").Table("table_status").Get(tableId).Changes().OptArgs(r.ChangesOpts{IncludeInitial: true}), suite.session, r.RunOpts{}) |
| 508 | _ = rtblPluck // Prevent any noused variable errors |
| 509 | |
| 510 | { |
| 511 | // changefeeds/point.yaml line #137 |
| 512 | /* partial([{'new_val':partial({'db':'test'})}]) */ |
| 513 | var expected_ compare.Expected = compare.PartialMatch([]interface{}{map[interface{}]interface{}{"new_val": compare.PartialMatch(map[interface{}]interface{}{"db": "db_feed_point"})}}) |
| 514 | /* fetch(rtblPluck, 1) */ |
| 515 | |
| 516 | suite.T().Log("About to run line #137: fetch(rtblPluck, 1)") |
| 517 | |
| 518 | fetchAndAssert(suite.Suite, expected_, rtblPluck, 1) |
| 519 | suite.T().Log("Finished running line #137") |
| 520 | } |
| 521 | |
| 522 | { |
| 523 | // changefeeds/point.yaml line #140 |
| 524 | /* AnythingIsFine */ |
| 525 | var expected_ string = compare.AnythingIsFine |
| 526 | /* table_test_changefeed_point.reconfigure(shards=3, replicas=1) */ |
| 527 | |
| 528 | suite.T().Log("About to run line #140: table_test_changefeed_point.Reconfigure().OptArgs(r.ReconfigureOpts{Shards: 3, Replicas: 1, })") |
| 529 | |
| 530 | runAndAssert(suite.Suite, expected_, table_test_changefeed_point.Reconfigure().OptArgs(r.ReconfigureOpts{Shards: 3, Replicas: 1}), suite.session, r.RunOpts{ |
| 531 | GeometryFormat: "raw", |
| 532 | GroupFormat: "map", |
| 533 | }) |
| 534 | suite.T().Log("Finished running line #140") |
| 535 | } |
| 536 | |
| 537 | { |
| 538 | // changefeeds/point.yaml line #143 |
| 539 | /* partial([{'old_val':partial({'db':'test'}), 'new_val':partial({'db':'test'})}]) */ |
| 540 | var expected_ compare.Expected = compare.PartialMatch([]interface{}{map[interface{}]interface{}{"old_val": compare.PartialMatch(map[interface{}]interface{}{"db": "db_feed_point"}), "new_val": compare.PartialMatch(map[interface{}]interface{}{"db": "db_feed_point"})}}) |
| 541 | /* fetch(rtblPluck, 1, 2) */ |
| 542 | |
| 543 | suite.T().Log("About to run line #143: fetch(rtblPluck, 1)") |
| 544 | |
| 545 | fetchAndAssert(suite.Suite, expected_, rtblPluck, 1) |
| 546 | suite.T().Log("Finished running line #143") |
| 547 | } |
| 548 | } |