def test_deserialise_1(self): ''' Deserialise expecting 1 bitflag set ''' bitflags = State.deserialise_bitflags(2) self.assertEqual(bitflags, {1: True})
def test_deserialise_1026(self): ''' Deserialise expecting 1 and 10 bitflags set ''' bitflags = State.deserialise_bitflags(2**1 + 2**10) self.assertEqual(bitflags, {1: True, 10: True})
def test_deserialise_0(self): ''' Deserialise with no bitflags ''' bitflags = State.deserialise_bitflags(0) self.assertEqual(bitflags, {})