| 1489 | eq_(row._mapping[s.c.user_name], "ed") |
| 1490 | |
| 1491 | def test_ro_mapping_py3k(self, connection): |
| 1492 | users = self.tables.users |
| 1493 | |
| 1494 | connection.execute(users.insert(), dict(user_id=1, user_name="foo")) |
| 1495 | result = connection.execute(users.select()) |
| 1496 | |
| 1497 | row = result.first() |
| 1498 | dict_row = row._asdict() |
| 1499 | |
| 1500 | # dictionaries aren't ordered in Python 3 until 3.7 |
| 1501 | odict_row = collections.OrderedDict( |
| 1502 | [("user_id", 1), ("user_name", "foo")] |
| 1503 | ) |
| 1504 | eq_(dict_row, odict_row) |
| 1505 | |
| 1506 | mapping_row = row._mapping |
| 1507 | |
| 1508 | eq_(list(mapping_row), list(mapping_row.keys())) |
| 1509 | eq_(odict_row.keys(), mapping_row.keys()) |
| 1510 | eq_(odict_row.values(), mapping_row.values()) |
| 1511 | eq_(odict_row.items(), mapping_row.items()) |
| 1512 | |
| 1513 | @testing.combinations( |
| 1514 | (lambda result: result), |