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

Method test06a

tables/tests/test_indexvalues.py:942–967  ·  view source on GitHub ↗

Checking get_where_list & itersequence (bool flavor)

(self)

Source from the content-addressed store, hash-verified

940 self.assertEqual(results1, results2)
941
942 def test06a(self):
943 """Checking get_where_list & itersequence (bool flavor)"""
944
945 if common.verbose:
946 print("\n", "-=" * 30)
947 print("Running %s.test06a..." % self.__class__.__name__)
948
949 table1 = self.h5file.root.table1
950 table2 = self.h5file.root.table2
951
952 # Do some selections and check the results
953 t1var2 = table1.cols.var2
954 condition = "t1var2==True"
955 self.assertTrue(
956 table1.will_query_use_indexing(condition)
957 == fzset([t1var2.pathname])
958 )
959 table1.flavor = "python"
960 rowList1 = table1.get_where_list(condition)
961 results1 = [p["var2"] for p in table1.itersequence(rowList1)]
962 results2 = [p["var2"] for p in table2 if p["var2"] is True]
963 if common.verbose:
964 print("Length results:", len(results1))
965 print("Should be:", len(results2))
966 self.assertEqual(len(results1), len(results2))
967 self.assertEqual(results1, results2)
968
969 def test06b(self):
970 """Checking get_where_list & itersequence (numpy bool limits &

Callers

nothing calls this directly

Calls 3

get_where_listMethod · 0.80
itersequenceMethod · 0.80

Tested by

no test coverage detected