def test_query_ops(self):
		from grease.component.field import FieldAccessor
		comp = TestComponent()
		for i in range(1,4):
			comp[i] = TestData(x=i*i, pos=TestData(x=i, y=-i))
			comp[i+3] = TestData(x=i*i, pos=TestData(x=i, y=-i))
			comp[i+6] = TestData(x=i*i, pos=TestData(x=i, y=-i))
		entities = set(range(1,7))
		x_accessor = FieldAccessor(TestField(comp, 'x'), entities)
		self.assertEqual(x_accessor == 4, set([2, 5]))
		self.assertEqual(x_accessor == 0, set())
		self.assertEqual(x_accessor != 1, set([2, 3, 5, 6]))
		self.assertEqual(x_accessor != 33, set([1, 2, 3, 4, 5, 6]))
		self.assertEqual(x_accessor > 5, set([3, 6]))
		self.assertEqual(x_accessor > 9, set())
		self.assertEqual(x_accessor >= 4, set([2, 3, 5, 6]))
		self.assertEqual(x_accessor >= 10, set())
		self.assertEqual(x_accessor < 2, set([1, 4]))
		self.assertEqual(x_accessor < 1, set())
		self.assertEqual(x_accessor <= 4, set([1, 2, 4, 5]))
		self.assertEqual(x_accessor <= -1, set())

		pos_accessor = FieldAccessor(TestField(comp, 'pos'), entities)
		self.assertEqual(pos_accessor.x == 3, set([3, 6]))
		self.assertEqual(pos_accessor.x < 3, set([1, 2, 4, 5]))
dataset/ETHPy150Open caseman/grease/test/field_test.py/FieldAccessorTestCase.test_query_ops/original