pykd
1import unittest
2import pykd
3import sys
4import os
5
6class TaggedTest(unittest.TestCase):
7def setUp(self):
8dump_file = os.path.join( os.path.dirname(sys.argv[0]),
9r"..\..\kdlibcpp\kdlib\tests\dumps\win8_x64_mem\win8_x64_mem.cab" )
10self.dump_id = pykd.loadDump( dump_file )
11
12self._existing_id = "D03DC06F-D88E-44C5-BA2A-FAE035172D19"
13self._non_existing_id = "88597A32-1493-41CA-BF87-2A950DF4CEE0"
14
15def tearDown(self):
16pykd.closeDump( self.dump_id )
17
18def testEnum(self):
19ids = pykd.enumTagged()
20
21self.assertTrue( self._existing_id.lower() in [i.lower() for i in ids] )
22
23self.assertFalse( self._non_existing_id.lower() in [i.lower() for i in ids] )
24
25
26def testLoadBuffer(self):
27buff = pykd.loadTaggedBuffer( self._existing_id )
28self.assertEqual( len(buff), 0x410 )
29
30self.assertRaises( pykd.DbgException, pykd.loadTaggedBuffer, self._non_existing_id )
31
32