class ImproperTarget(unittest.TestCase): """This handles the case where the filename provided to DLL is not a dll. All queries against a non-dll should return 0. """ def setUp(self): self.myDll = DLL(badDataSource) def testGetMemorySize(self): """ImproperTarget::getMemorySize()""" assertEquals('Memory size: ', self.myDll.getMemorySize(), 0) def testGetRoundedMemorySize(self): """ImproperTarget::getRoundedMemorySize()""" assertEquals('Rounded memory size: ', self.myDll.getRoundedMemorySize(), 0) def testGetBaseAddress(self): """ProperTarget::getBaseAddress()""" assertEquals('Base address: ', self.myDll.getBaseAddress(), 0)
class ProperTarget(unittest.TestCase): """This handles the case where the file is a proper dll. """ def setUp(self): self.myDll = DLL(goodDataSource) def testGetMemorySize(self): """ProperTarget::getMemorySize()""" assertEquals('Memory size: ', self.myDll.getMemorySize(), 8192) def testGetRoundedMemorySize(self): """ProperTarget::getRoundedMemorySize()""" assertEquals('Rounded size: ', self.myDll.getRoundedMemorySize(), 65536) def testGetBaseAddress(self): """ProperTarget::getBaseAddress()""" assertEquals('Base address: ', '%x' % self.myDll.getBaseAddress(), '73dc0000')
class ProperTarget( unittest.TestCase ): """This handles the case where the file is a proper dll. """ def setUp( self ): self.myDll = DLL( goodDataSource ) def testGetMemorySize( self ): """ProperTarget::getMemorySize()""" assertEquals( 'Memory size: ' , self.myDll.getMemorySize(), 8192 ) def testGetRoundedMemorySize( self ): """ProperTarget::getRoundedMemorySize()""" assertEquals( 'Rounded size: ' , self.myDll.getRoundedMemorySize(), 65536 ) def testGetBaseAddress( self ): """ProperTarget::getBaseAddress()""" assertEquals( 'Base address: ', '%x' % self.myDll.getBaseAddress(), '73dc0000' )
class ImproperTarget(unittest.TestCase): """This handles the case where the filename provided to DLL is not a dll. All queries against a non-dll should return 0. """ def setUp(self): self.myDll = DLL( badDataSource ) def testGetMemorySize( self ): """ImproperTarget::getMemorySize()""" assertEquals( 'Memory size: ', self.myDll.getMemorySize(), 0 ) def testGetRoundedMemorySize( self ): """ImproperTarget::getRoundedMemorySize()""" assertEquals( 'Rounded memory size: ', self.myDll.getRoundedMemorySize(), 0 ) def testGetBaseAddress( self ): """ProperTarget::getBaseAddress()""" assertEquals( 'Base address: ', self.myDll.getBaseAddress(), 0 )