# Path: spanner_orm/tests/models.py
# class SmallTestModel(model.Model):
# class SmallTestModelWithoutSecondaryIndexes(model.Model):
# class ChildTestModel(model.Model):
# class IndexTestModel(model.Model):
# class RelationshipTestModel(model.Model):
# class ForeignKeyTestModel(model.Model):
# class InheritanceTestModel(SmallTestModel):
# class UnittestModel(model.Model):
# class UnittestModelWithoutSecondaryIndexes(model.Model):
# class NullFilteredIndexModel(model.Model):


import logging
import unittest
from spanner_orm.tests import models
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class MetadataTest(unittest.TestCase):

  def test_metadata_present(self):
    columns = ['key', 'value_1', 'value_2']
    indexes = ['PRIMARY_KEY', 'index_1']
    table = 'SmallTestModel'
    self.assertCountEqual(columns, models.SmallTestModel.meta.columns)
    self.assertCountEqual(columns, models.SmallTestModel.meta.fields.keys())
    self.assertCountEqual(indexes, models.SmallTestModel.meta.indexes.keys())
    self.assertEqual(table, models.SmallTestModel.meta.table)

  def test_metadata_inheritance(self):
    self.assertEqual(models.SmallTestModel.meta.indexes,
                     models.InheritanceTestModel.meta.indexes)

    self.assertEqual(models.SmallTestModel.meta.table,
                     models.InheritanceTestModel.meta.table)

    self.assertEqual(models.SmallTestModel.meta.relations,
                     models.InheritanceTestModel.meta.relations)

    self.assertEqual(models.SmallTestModel.meta.interleaved,

# Path: spanner_orm/tests/models.py
# class SmallTestModel(model.Model):
# class SmallTestModelWithoutSecondaryIndexes(model.Model):
# class ChildTestModel(model.Model):
# class IndexTestModel(model.Model):
# class RelationshipTestModel(model.Model):
# class ForeignKeyTestModel(model.Model):
# class InheritanceTestModel(SmallTestModel):
# class UnittestModel(model.Model):
# class UnittestModelWithoutSecondaryIndexes(model.Model):
# class NullFilteredIndexModel(model.Model):


# Path: spanner_orm/tests/metadata_test.py
import logging
import unittest
from spanner_orm.tests import models

# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.




class MetadataTest(unittest.TestCase):

  def test_metadata_present(self):
    columns = ['key', 'value_1', 'value_2']
    indexes = ['PRIMARY_KEY', 'index_1']
    table = 'SmallTestModel'
    self.assertCountEqual(columns, models.SmallTestModel.meta.columns)
    self.assertCountEqual(columns, models.SmallTestModel.meta.fields.keys())
    self.assertCountEqual(indexes, models.SmallTestModel.meta.indexes.keys())
    self.assertEqual(table, models.SmallTestModel.meta.table)

  def test_metadata_inheritance(self):
    self.assertEqual(models.SmallTestModel.meta.indexes,
                     models.InheritanceTestModel.meta.indexes)

    self.assertEqual(models.SmallTestModel.meta.table,
                     models.InheritanceTestModel.meta.table)

    self.assertEqual(models.SmallTestModel.meta.relations,
                     models.InheritanceTestModel.meta.relations)

    self.assertEqual(models.SmallTestModel.meta.interleaved,

                     models.InheritanceTestModel.meta.interleaved)