MCPcopy Create free account
hub / github.com/PyTables/PyTables / assertEqualColinstances

Method assertEqualColinstances

tables/tests/test_tables.py:5726–5742  ·  view source on GitHub ↗

Assert that column instance maps of both tables are equal.

(self, table1, table2)

Source from the content-addressed store, hash-verified

5724
5725class CopyTestCase(common.TempFileMixin, common.PyTablesTestCase):
5726 def assertEqualColinstances(self, table1, table2):
5727 """Assert that column instance maps of both tables are equal."""
5728
5729 cinst1, cinst2 = table1.colinstances, table2.colinstances
5730 self.assertEqual(len(cinst1), len(cinst2))
5731 for cpathname, col1 in cinst1.items():
5732 self.assertTrue(cpathname in cinst2)
5733 col2 = cinst2[cpathname]
5734 self.assertIsInstance(col1, type(col2))
5735 if isinstance(col1, tb.Column):
5736 self.assertEqual(col1.name, col2.name)
5737 self.assertEqual(col1.pathname, col2.pathname)
5738 self.assertEqual(col1.dtype, col2.dtype)
5739 self.assertEqual(col1.type, col2.type)
5740 elif isinstance(col1, tb.Cols):
5741 self.assertEqual(col1._v_colnames, col2._v_colnames)
5742 self.assertEqual(col1._v_colpathnames, col2._v_colpathnames)
5743
5744 def test01_copy(self):
5745 """Checking Table.copy() method."""

Callers 6

test01_copyMethod · 0.95
test02_copyMethod · 0.95
test03_copyMethod · 0.95
test04_copyMethod · 0.95
test05_copyMethod · 0.95
test05b_copyMethod · 0.95

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected