# Path: oslo_db/sqlalchemy/models.py
# class ModelBase(object):
# class ModelIterator(object):
# class TimestampMixin(object):
# class SoftDeleteMixin(object):
#     def save(self, session):
#     def __setitem__(self, key, value):
#     def __getitem__(self, key):
#     def __contains__(self, key):
#     def get(self, key, default=None):
#     def _extra_keys(self):
#     def __iter__(self):
#     def update(self, values):
#     def _as_dict(self):
#     def iteritems(self):
#     def items(self):
#     def keys(self):
#     def __init__(self, model, columns):
#     def __iter__(self):
#     def __next__(self):
#     def soft_delete(self, session):
# 
# Path: oslo_db/tests/base.py
# class BaseTestCase(base.BaseTestCase):
#     def setUp(self):
# 
# Path: oslo_db/tests/sqlalchemy/base.py
# class Context(object):
# class DbTestCase(db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase):
# class MySQLOpportunisticTestCase(DbTestCase):
# class PostgreSQLOpportunisticTestCase(DbTestCase):
# class _DbTestCase(
#     db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase,
# ):
# class _MySQLOpportunisticTestCase(_DbTestCase):
# class _PostgreSQLOpportunisticTestCase(_DbTestCase):
#     def setUp(self):
#     def setUp(self):
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture


from collections import abc
from unittest import mock
from sqlalchemy import Column
from sqlalchemy import Integer, String
from sqlalchemy import event
from sqlalchemy.orm import declarative_base
from oslo_db.sqlalchemy import models
from oslo_db.tests import base as test_base
from oslo_db.tests.sqlalchemy import base as db_test_base
import datetime
            'smth': None,
            'name': 'NAME',
        }
        i = iter(self.ekm)
        found_items = 0
        while True:
            r = next(i, None)
            if r is None:
                break
            self.assertEqual(expected[r[0]], r[1])
            found_items += 1

        self.assertEqual(len(expected), found_items)

    def test_modelbase_keys(self):
        self.assertEqual(set(('id', 'smth', 'name')), set(self.ekm.keys()))

        self.ekm.update({'a': '1', 'b': '2'})
        self.assertEqual(set(('a', 'b', 'id', 'smth', 'name')),
                         set(self.ekm.keys()))

    def test_modelbase_several_iters(self):
        mb = ExtraKeysModel()
        it1 = iter(mb)
        it2 = iter(mb)

        self.assertFalse(it1 is it2)
        self.assertEqual(dict(mb), dict(it1))
        self.assertEqual(dict(mb), dict(it2))


# Path: oslo_db/sqlalchemy/models.py
# class ModelBase(object):
# class ModelIterator(object):
# class TimestampMixin(object):
# class SoftDeleteMixin(object):
#     def save(self, session):
#     def __setitem__(self, key, value):
#     def __getitem__(self, key):
#     def __contains__(self, key):
#     def get(self, key, default=None):
#     def _extra_keys(self):
#     def __iter__(self):
#     def update(self, values):
#     def _as_dict(self):
#     def iteritems(self):
#     def items(self):
#     def keys(self):
#     def __init__(self, model, columns):
#     def __iter__(self):
#     def __next__(self):
#     def soft_delete(self, session):
# 
# Path: oslo_db/tests/base.py
# class BaseTestCase(base.BaseTestCase):
#     def setUp(self):
# 
# Path: oslo_db/tests/sqlalchemy/base.py
# class Context(object):
# class DbTestCase(db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase):
# class MySQLOpportunisticTestCase(DbTestCase):
# class PostgreSQLOpportunisticTestCase(DbTestCase):
# class _DbTestCase(
#     db_fixtures.OpportunisticDBTestMixin, test_base.BaseTestCase,
# ):
# class _MySQLOpportunisticTestCase(_DbTestCase):
# class _PostgreSQLOpportunisticTestCase(_DbTestCase):
#     def setUp(self):
#     def setUp(self):
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture
#     FIXTURE = db_fixtures.MySQLOpportunisticFixture
#     FIXTURE = db_fixtures.PostgresqlOpportunisticFixture


# Path: oslo_db/tests/sqlalchemy/test_models.py
from collections import abc
from unittest import mock
from sqlalchemy import Column
from sqlalchemy import Integer, String
from sqlalchemy import event
from sqlalchemy.orm import declarative_base
from oslo_db.sqlalchemy import models
from oslo_db.tests import base as test_base
from oslo_db.tests.sqlalchemy import base as db_test_base
import datetime

            'smth': None,
            'name': 'NAME',
        }
        i = iter(self.ekm)
        found_items = 0
        while True:
            r = next(i, None)
            if r is None:
                break
            self.assertEqual(expected[r[0]], r[1])
            found_items += 1

        self.assertEqual(len(expected), found_items)

    def test_modelbase_keys(self):
        self.assertEqual(set(('id', 'smth', 'name')), set(self.ekm.keys()))

        self.ekm.update({'a': '1', 'b': '2'})
        self.assertEqual(set(('a', 'b', 'id', 'smth', 'name')),
                         set(self.ekm.keys()))

    def test_modelbase_several_iters(self):
        mb = ExtraKeysModel()
        it1 = iter(mb)
        it2 = iter(mb)

        self.assertFalse(it1 is it2)
        self.assertEqual(dict(mb), dict(it1))
        self.assertEqual(dict(mb), dict(it2))


    def test_extra_keys_empty(self):