Allow block.get() to return the dna.Field

This is needed by the upcoming dependency tracer.
This commit is contained in:
Sybren A. Stüvel
2018-02-26 18:15:14 +01:00
parent a56e985cdc
commit 59c0b6df4c
4 changed files with 29 additions and 21 deletions
+2 -2
View File
@@ -19,12 +19,12 @@ class BlendFileBlockTest(AbstractBlendFileTest):
# Try low level operation to read a property.
self.bf.fileobj.seek(ob.file_offset, os.SEEK_SET)
loc = ob.dna_type.field_get(self.bf.header, self.bf.fileobj, b'loc')
_, loc = ob.dna_type.field_get(self.bf.header, self.bf.fileobj, b'loc')
self.assertEqual([2.0, 3.0, 5.0], loc)
# Try low level operation to read an array element.
self.bf.fileobj.seek(ob.file_offset, os.SEEK_SET)
loc_z = ob.dna_type.field_get(self.bf.header, self.bf.fileobj, (b'loc', 2))
_, loc_z = ob.dna_type.field_get(self.bf.header, self.bf.fileobj, (b'loc', 2))
self.assertEqual(5.0, loc_z)
# Try high level operation to read the same property.