mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-12-22 16:48:33 +01:00
Fix: MutableRecord.__ne__ misspelt as '__neq__'.
Add tests for MutableRecord and Position.
This commit is contained in:
parent
4b6feda1cb
commit
bea2222c58
@ -67,7 +67,7 @@ class MutableRecord(object):
|
|||||||
return type(self) is type(other) and \
|
return type(self) is type(other) and \
|
||||||
all(getattr(self, a) == getattr(other, a) for a in self.__slots__)
|
all(getattr(self, a) == getattr(other, a) for a in self.__slots__)
|
||||||
|
|
||||||
def __neq__(self, other):
|
def __ne__(self, other):
|
||||||
return not (self == other)
|
return not (self == other)
|
||||||
|
|
||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
|
@ -28,7 +28,7 @@ TEST_DATA = {
|
|||||||
TrailingByteArray: [b'Q^jO<5*|+o LGc('],
|
TrailingByteArray: [b'Q^jO<5*|+o LGc('],
|
||||||
UUID: ["12345678-1234-5678-1234-567812345678"],
|
UUID: ["12345678-1234-5678-1234-567812345678"],
|
||||||
StringType: ["hello world"],
|
StringType: ["hello world"],
|
||||||
Position: [(758, 0, 691)],
|
Position: [(758, 0, 691), (-500, -12, -684)],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,3 +69,7 @@ class PositionAndLookTest(unittest.TestCase):
|
|||||||
self.assertEqual(pos_look_1.look, pos_look_2.look)
|
self.assertEqual(pos_look_1.look, pos_look_2.look)
|
||||||
self.assertEqual(hash(pos_look_1), hash(pos_look_2))
|
self.assertEqual(hash(pos_look_1), hash(pos_look_2))
|
||||||
self.assertEqual(str(pos_look_1), string_repr)
|
self.assertEqual(str(pos_look_1), string_repr)
|
||||||
|
|
||||||
|
self.assertFalse(pos_look_1 != pos_look_2)
|
||||||
|
pos_look_1.position += Vector(1, 1, 1)
|
||||||
|
self.assertTrue(pos_look_1 != pos_look_2)
|
||||||
|
Loading…
Reference in New Issue
Block a user