From b7ca56b086d4c3a7c154c7f7c1cf71c1f32954ce Mon Sep 17 00:00:00 2001 From: Richard Neumann Date: Mon, 14 Feb 2022 11:45:46 +0100 Subject: [PATCH] Add unit tests for BattlEye --- tests/__init__.py | 1 + tests/test_battleye_proto.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/__init__.py create mode 100644 tests/test_battleye_proto.py diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e0310a0 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +"""Unit tests.""" diff --git a/tests/test_battleye_proto.py b/tests/test_battleye_proto.py new file mode 100644 index 0000000..1569898 --- /dev/null +++ b/tests/test_battleye_proto.py @@ -0,0 +1,17 @@ +"""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)