drgn/tests/test_platform.py
Omar Sandoval 660276a0b8 Format Python code with Black
I'm not a fan of 100% of the Black coding style, but I've spent too much
time manually formatting Python code, so let's just pull the trigger.
2020-01-14 11:51:58 -08:00

16 lines
489 B
Python

import unittest
from drgn import Architecture, Platform, PlatformFlags
class TestPlatform(unittest.TestCase):
def test_default_flags(self):
Platform(Architecture.X86_64)
self.assertRaises(ValueError, Platform, Architecture.UNKNOWN)
def test_registers(self):
self.assertIn(
"rax", (reg.name for reg in Platform(Architecture.X86_64).registers)
)
self.assertEqual(Platform(Architecture.UNKNOWN, PlatformFlags(0)).registers, ())