Exemple #1
0
	def test_accessor_subset(self):
		from bGrease.component.field import Field
		comp = TestComponent((1,2,3,4))
		f = Field(comp, "acc_default", str, TestAccessor)
		acc = f.accessor(set([2,4,6,8]))
		self.assertTrue(acc.field is f, (acc.field, f))
		self.assertEqual(acc.entities, set([2,4]))
Exemple #2
0
	def test_accessor_default_set(self):
		from bGrease.component.field import Field
		comp = TestComponent()
		f = Field(comp, "acc_default", str, TestAccessor)
		acc = f.accessor()
		self.assertTrue(acc.field is f, (acc.field, f))
		self.assertTrue(acc.entities is comp.entities, (acc.entities, comp.entities))