From bc9224e40bd0893da3e395791a004aacdb01f739 Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Wed, 29 May 2024 20:05:41 -0400 Subject: [PATCH] Added base for tests --- tests/__init.py__.py | 11 +++++++++++ tests/test_commonkeys.py | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 tests/__init.py__.py create mode 100644 tests/test_commonkeys.py diff --git a/tests/__init.py__.py b/tests/__init.py__.py new file mode 100644 index 0000000..ef0634e --- /dev/null +++ b/tests/__init.py__.py @@ -0,0 +1,11 @@ +# "__init__.py" from libWiiPy by NinjaCheetah & Contributors +# https://github.com/NinjaCheetah/libWiiPy +# +# Complete set of tests to be run. + +import unittest + +from test_commonkeys import TestCommonKeys + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_commonkeys.py b/tests/test_commonkeys.py new file mode 100644 index 0000000..0bba6d5 --- /dev/null +++ b/tests/test_commonkeys.py @@ -0,0 +1,21 @@ +# "test_commonkeys.py" from libWiiPy by NinjaCheetah & Contributors +# https://github.com/NinjaCheetah/libWiiPy + +import unittest + +from libWiiPy import commonkeys + + +class TestCommonKeys(unittest.TestCase): + def test_common(self): + self.assertEqual(commonkeys.get_common_key(0), b'\xeb\xe4*"^\x85\x93\xe4H\xd9\xc5Es\x81\xaa\xf7') + + def test_korean(self): + self.assertEqual(commonkeys.get_common_key(1), b'c\xb8+\xb4\xf4aN.\x13\xf2\xfe\xfb\xbaL\x9b~') + + def test_vwii(self): + self.assertEqual(commonkeys.get_common_key(2), b'0\xbf\xc7n|\x19\xaf\xbb#\x1630\xce\xd7\xc2\x8d') + + +if __name__ == '__main__': + unittest.main()