コード例 #1
0
 def test_deserialise_1(self):
     ''' Deserialise expecting 1 bitflag set '''
     bitflags = State.deserialise_bitflags(2)
     self.assertEqual(bitflags, {1: True})
コード例 #2
0
 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})
コード例 #3
0
 def test_deserialise_0(self):
     ''' Deserialise with no bitflags
     '''
     bitflags = State.deserialise_bitflags(0)
     self.assertEqual(bitflags, {})