当前位置: 首页>>代码示例>>Python>>正文


Python test.assertEquals函数代码示例

本文整理汇总了Python中test.assertEquals函数的典型用法代码示例。如果您正苦于以下问题:Python assertEquals函数的具体用法?Python assertEquals怎么用?Python assertEquals使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assertEquals函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: testSelfDecrement

 def testSelfDecrement( self ):
     ticks = self.ts1.getLocalTicks() + 30000
     self.ts2 = Timestamp( ticks )
     self.ts2 -= 30000
     assertEquals( 'Ticks',
                   self.ts2.getLocalTicks() ,
                   self.ts1.getLocalTicks() )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:7,代码来源:test_timestamp.py

示例2: testAddModule

 def testAddModule( self ):
     """SuccessfulSetupTestCase::addModule()"""
     modules   = self.bif.getModules()
     newModule = modules[ 0 ]
     newModule.id = 'new_module'
     self.bif.addModule( newModule )
     assertEquals( 'Number of modules' ,
                   len( self.bif.getModules() ),
                   4 )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:9,代码来源:test_bif.py

示例3: testAdd

 def testAdd( self ):
     target = self.ts1.getLocalTicks() + 29000
     self.ts1 = self.ts3 + 29000        
     assertEquals( 'Ticks' ,
                   self.ts1.getLocalTicks() ,
                   target )
     # Make sure ts3 was unchanged by the operation.
     assertEquals( 'Ticks' ,
                   self.ts3.getLocalTicks() ,
                   ticks1 )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:10,代码来源:test_timestamp.py

示例4: testNumberOfTimesInFile

 def testNumberOfTimesInFile( self ):
     self.basefile.recordDLL( self.dllName , self.newBase , self.newSize )
     count = 0
     for line in open( scratchFile , "r" ).readlines():            
         l = string.split(line,";")[0]        
         l = string.replace(l,"\t"," ")
         if l == 'server\\fs\\adminfs\\rel32\\bogus.dll 0x60000000 0x30000 ':
             count += 1                                
     assertEquals( '# of occurences of dll found in file: ',
                   count,
                   1 )                     
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:11,代码来源:test_basefile.py

示例5: testSubtract

 def testSubtract( self ):
     ticks = self.ts1.getLocalTicks() + 30000
     self.ts2 = Timestamp( ticks )
     self.ts1 = self.ts2 - 30000
     assertEquals( 'Ticks' ,
                   self.ts1.getLocalTicks(),
                   ticks1 )
     # Make sure ts2 was unchanged by the operation.
     assertEquals( 'Ticks' ,
                   self.ts2.getLocalTicks() ,
                   ticks )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:11,代码来源:test_timestamp.py

示例6: testSaveData

 def testSaveData( self ):
     """SuccessfulSetupTestCase::saveData()"""
     tempSource = os.path.join( testRoot , 'test-out.bif' )
     self.bif.setDataSource( tempSource )
     self.bif.saveData()
     self.bif.removeModule( 'module1' )
     assertEquals( 'Modules in memory' , 
                   len( self.bif.getModules() ),
                   2 )
     self.bif.loadData()
     # Only 2 modules in test-out because it is deleting the shadow module.
     # Is this desired behavior?
     assertEquals( 'Modules in test-out.bif' ,
                   len( self.bif.getModules() ),
                   2 )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:15,代码来源:test_bif.py

示例7: testRemoveModule

 def testRemoveModule( self ):
     """SuccessfulSetupTestCase::removeModule()"""
     self.bif.removeModule( 'module1' )
     assertEquals( 'Number of modules' ,
                   len( self.bif.getModules() ),
                   2 )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:6,代码来源:test_bif.py

示例8: testGetDataAsFormattedString

 def testGetDataAsFormattedString( self ):
     """SuccessfulSetupTestCase::getDataAsFormattedString()"""
     assertEquals( 'Formatted string length' , 
                   len( self.bif.getDataAsFormattedString().split('\n') ) , 
                   32 )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:5,代码来源:test_bif.py

示例9: testSetDefaultCVSTagType

 def testSetDefaultCVSTagType( self ):
     """SuccessfulSetupTestCase::setDefaultCVSTagType()"""
     self.bif.setDefaultCVSTagType( 'branch' )
     assertEquals( 'Setting CVS type' ,
                   self.bif.getDefaultCVSTagType() ,
                   'branch' )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:6,代码来源:test_bif.py

示例10: testSetDefaultCVSTag

 def testSetDefaultCVSTag( self ):
     """SuccessfulSetupTestCase::setDefaultCVSTag()"""
     self.bif.setDefaultCVSTag( 'new_tag' )
     assertEquals( 'Setting CVS tag' , 
                   self.bif.getDefaultCVSTag() , 
                   'new_tag' )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:6,代码来源:test_bif.py

示例11: testGetDataSource

 def testGetDataSource( self ):
     """SuccessfulSetupTestCase::getDataSource()"""
     assertEquals( 'Data source' , 
                   self.bif.getDataSource() , 
                   self.dataSource )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:5,代码来源:test_bif.py

示例12: testRecordDLL

 def testRecordDLL( self ):
     self.basefile.recordDLL( self.dllName , self.newBase , self.newSize )
     assertEquals( 'Base address: ',
                   self.basefile.getNextBaseAddress( 'bogus' ),
                   self.newBase + self.newSize )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:5,代码来源:test_basefile.py

示例13: testGetDefaultCVSRoot

 def testGetDefaultCVSRoot( self ):
     """SuccessfulSetupTestCase::getDefaultCVSRoot()"""
     assertEquals( 'Default CVS root' , 
                   self.bif.getDefaultCVSRoot() , 
                   'test_root' )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:5,代码来源:test_bif.py

示例14: testGetBaseAddressOfFile

 def testGetBaseAddressOfFile( self ):
     assertEquals( 'Base address: ',
                   self.basefile.getBaseAddressOfFile( self.dllName ),
                   self.base )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:4,代码来源:test_basefile.py

示例15: testGetExpiration

 def testGetExpiration( self ):
     """SuccessfulSetupTestCase::getExpiration()"""
     # Invokes a method of the Timestamp class.
     assertEquals( 'Expires ticks' ,
                   self.bif.getExpiration().getLocalTicks() ,
                   1167638400 )
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:6,代码来源:test_bif.py


注:本文中的test.assertEquals函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。