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

Method test06b

tables/tests/test_indexvalues.py:969–997  ·  view source on GitHub ↗

Checking get_where_list & itersequence (numpy bool limits & flavor)

(self)

Source from the content-addressed store, hash-verified

967 self.assertEqual(results1, results2)
968
969 def test06b(self):
970 """Checking get_where_list & itersequence (numpy bool limits &
971 flavor)"""
972
973 if common.verbose:
974 print("\n", "-=" * 30)
975 print("Running %s.test06b..." % self.__class__.__name__)
976
977 table1 = self.h5file.root.table1
978 table2 = self.h5file.root.table2
979
980 # Do some selections and check the results
981 t1var2 = table1.cols.var2
982 false = np.bool_(False)
983 self.assertFalse(false) # silence pyflakes
984 condition = "t1var2==false"
985 self.assertTrue(
986 table1.will_query_use_indexing(condition)
987 == fzset([t1var2.pathname])
988 )
989 table1.flavor = "python"
990 rowList1 = table1.get_where_list(condition)
991 results1 = [p["var2"] for p in table1.itersequence(rowList1)]
992 results2 = [p["var2"] for p in table2 if p["var2"] is False]
993 if common.verbose:
994 print("Length results:", len(results1))
995 print("Should be:", len(results2))
996 self.assertEqual(len(results1), len(results2))
997 self.assertEqual(results1, results2)
998
999 def test07a(self):
1000 """Checking get_where_list & itersequence (int flavor)"""

Callers

nothing calls this directly

Calls 3

get_where_listMethod · 0.80
itersequenceMethod · 0.80

Tested by

no test coverage detected