(node, kind, expected)
| 14 | |
| 15 | # While we're doing this, check sql plugin's representation too. |
| 16 | def check_sql(node, kind, expected): |
| 17 | columns = only_one(node.rpc.listsqlschemas(kind)['schemas'])['columns'] |
| 18 | ret = node.rpc.sql(f"SELECT * FROM {kind}") |
| 19 | assert len(ret['rows']) == len(expected) |
| 20 | for row, e in zip(ret['rows'], expected): |
| 21 | assert len(row) == len(columns) |
| 22 | for val, col in zip(row, columns): |
| 23 | if col['name'] in e: |
| 24 | assert val == e[col['name']], f"{col['name']} is {val} not {e[col['name']]}: ({row} vs {columns})" |
| 25 | elif col['name'] not in ('rowid', 'timestamp'): |
| 26 | assert val is None, f"{col['name']} is not None ({row} vs {columns})" |
| 27 | |
| 28 | |
| 29 | def check_moves(moves, expected): |
no test coverage detected