Пример #1
0
def test_big_endian_conversions(as_int, as_big_endian):
    as_int_result = big_endian_to_int(as_big_endian)
    assert as_int_result == as_int

    as_big_endian_result = int_to_big_endian(as_int)
    assert as_big_endian_result == as_big_endian
Пример #2
0
def test_big_endian_round_trip_from_big_endian(value):
    result = int_to_big_endian(big_endian_to_int(value))
    assert result == value
Пример #3
0
 def set_last_pong_time(self, node_id: NodeID, last_pong: int) -> None:
     self.db.set(self._get_last_pong_time_key(node_id),
                 int_to_big_endian(last_pong))