File: test_battleye_proto.py

package info (click to toggle)
python-rcon 2.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 348 kB
  • sloc: python: 1,224; makefile: 42; sh: 6
file content (21 lines) | stat: -rw-r--r-- 500 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""Test the BattlEye protocol."""

from unittest import TestCase

from rcon.battleye.proto import Header


HEADER = Header(920575337, 0x00)
BYTES = b"BEi\xdd\xde6\xff\x00"


class TestHeader(TestCase):
    """Test header object."""

    def test_header_from_bytes(self):
        """Tests header object parsing."""
        self.assertEqual(Header.from_bytes(BYTES), HEADER)

    def test_header_to_bytes(self):
        """Tests header object parsing."""
        self.assertEqual(bytes(HEADER), BYTES)