def testAndSelector(self): c = CQ(makeUnitCube()) S = selectors.StringSyntaxSelector BS = selectors.BoxSelector el = c.edges( selectors.AndSelector(S('|X'), BS((-2, -2, 0.1), (2, 2, 2)))).vals() self.assertEqual(2, len(el)) # test 'and' (intersection) operator el = c.edges(S('|X') & BS((-2, -2, 0.1), (2, 2, 2))).vals() self.assertEqual(2, len(el))
def testAndSelector(self): c = CQ(makeUnitCube()) S = selectors.StringSyntaxSelector BS = selectors.BoxSelector el = c.edges( selectors.AndSelector(S("|X"), BS((-2, -2, 0.1), (2, 2, 2)))).vals() self.assertEqual(2, len(el)) # test 'and' (intersection) operator el = c.edges(S("|X") & BS((-2, -2, 0.1), (2, 2, 2))).vals() self.assertEqual(2, len(el)) # test using extended string syntax v = c.vertices(">X and >Y").vals() self.assertEqual(2, len(v))