Exemple #1
0
 def test_lambda(self):
     byte_string = general_pack(lambda x, y: x + y)
     byte_stream = ByteStream(byte_string)
     new_value = general_unpack(byte_stream)[0]
     self.assertEqual(10, new_value(5, 5))
Exemple #2
0
def single_value(test_self, value):
    byte_string = general_pack(value)
    byte_stream = ByteStream(byte_string)
    new_value = general_unpack(byte_stream)[0]
    test_self.assertEqual(value, new_value)
Exemple #3
0
 def pack(self) -> bytes:
     specific_byte_string = general_pack(self.function_name, self.args, self.kwargs)
     return super()._pack_all(specific_byte_string)
Exemple #4
0
 def pack(self) -> bytes:
     specific_byte_string = general_pack(self.src_path, self.dst_path, self.file_size)
     return super()._pack_all(specific_byte_string)
Exemple #5
0
 def pack(self) -> bytes:
     specific_byte_string = general_pack(self.data)
     return super()._pack_all(specific_byte_string)