mirror of
https://github.com/JakeHillion/drgn.git
synced 2024-12-23 17:53:07 +00:00
660276a0b8
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.
16 lines
489 B
Python
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, ())
|