Example #1
0
class QueryTestCaseNoAddendum( unittest.TestCase ):
    def setUp( self ):
        self.base = Version( '3.5.2' )
        
    def testGetMajor( self ):
        assertEquals( 'Major version number' ,
                      self.base.getMajor(),
                      3 )
      
    def testGetMinor( self ):
        assertEquals( 'Minor version number' ,
                      self.base.getMinor(),
                      5 )
                      
    def testGetPatch( self ):
        assertEquals( 'Patch level' ,
                      self.base.getPatch(),
                      2 )
              
    def testGetAddendum( self ):
        assertEquals( 'Addendum' ,
                      self.base.getAddendum(),
                      None )
                      
    def testPrintVersion( self ):
        verString = "%s" % self.base
        assertEquals( 'Version string' ,
                      verString,
                      '3.5.2' )

    def testGetVersionNoAddendum( self ):
        verString = self.base.getVersionNoAddendum()
        assertEquals( 'Version string - no add' ,
                      verString,
                      '3.5.2' )
Example #2
0
class MixedVersionNumber( unittest.TestCase ):
    def setUp( self ):
        self.base = Version( '2.4.4c1' )
        
    def testGetMajor( self ):
        assertEquals( 'Major version number' ,
                      self.base.getMajor(),
                      2 )
      
    def testGetMinor( self ):
        assertEquals( 'Minor version number' ,
                      self.base.getMinor(),
                      4 )
                      
    def testGetPatch( self ):
        assertEquals( 'Patch level' ,
                      self.base.getPatch(),
                      4 )
              
    def testGetAddendum( self ):
        assertEquals( 'Addendum' ,
                      self.base.getAddendum(),
                      'c1' )
                      
    def testPrintVersion( self ):
        verString = "%s" % self.base
        assertEquals( 'Version string' ,
                      verString,
                      '2.4.4-c1' )
                      
    def testGetVersionNoAddendum( self ):
        verString = self.base.getVersionNoAddendum()
        assertEquals( 'Version string - no add' ,
                      verString,
                      '2.4.4' )
Example #3
0
class TwoDigit( unittest.TestCase ):
    def setUp( self ):
        self.base = Version( '6.4-foob' )
        
    def testGetMajor( self ):
        assertEquals( 'Major version number' ,
                      self.base.getMajor(),
                      6 )
      
    def testGetMinor( self ):
        assertEquals( 'Minor version number' ,
                      self.base.getMinor(),
                      4 )
                      
    def testGetPatch( self ):
        assertEquals( 'Patch level' ,
                      self.base.getPatch(),
                      0 )
              
    def testGetAddendum( self ):
        assertEquals( 'Addendum' ,
                      self.base.getAddendum(),
                      'foob' )
                      
    def testPrintVersion( self ):
        verString = "%s" % self.base
        assertEquals( 'Version string' ,
                      verString,
                      '6.4-foob' )
                      
    def testGetVersionNoAddendum( self ):
        verString = self.base.getVersionNoAddendum()
        assertEquals( 'Version string - no add' ,
                      verString,
                      '6.4' )
Example #4
0
class TwoDashAdd( unittest.TestCase ):
    def setUp( self ):
        self.base = Version( '3.2.1-devel-test-twodash' )
        
    def testGetMajor( self ):
        assertEquals( 'Major version number' ,
                      self.base.getMajor(),
                      3 )
      
    def testGetMinor( self ):
        assertEquals( 'Minor version number' ,
                      self.base.getMinor(),
                      2 )
                      
    def testGetPatch( self ):
        assertEquals( 'Patch level' ,
                      self.base.getPatch(),
                      1 )
              
    def testGetAddendum( self ):
        assertEquals( 'Addendum' ,
                      self.base.getAddendum(),
                      'devel-test-twodash' )
                      
    def testPrintVersion( self ):
        verString = "%s" % self.base
        assertEquals( 'Version string' ,
                      verString,
                      '3.2.1-devel-test-twodash' )
                      
    def testGetVersionNoAddendum( self ):
        verString = self.base.getVersionNoAddendum()
        assertEquals( 'Version string - no add' ,
                      verString,
                      '3.2.1' )
Example #5
0
class FirstDigitZero( unittest.TestCase ):
    def setUp( self ):
        self.base = Version( '0.0.1' )
        
    def testGetMajor( self ):
        assertEquals( 'Major version number' ,
                      self.base.getMajor(),
                      0 )
      
    def testGetMinor( self ):
        assertEquals( 'Minor version number' ,
                      self.base.getMinor(),
                      0 )
                      
    def testGetPatch( self ):
        assertEquals( 'Patch level' ,
                      self.base.getPatch(),
                      1 )
              
    def testGetAddendum( self ):
        assertEquals( 'Addendum' ,
                      self.base.getAddendum(),
                      None )
                      
    def testPrintVersion( self ):
        verString = "%s" % self.base
        assertEquals( 'Version string' ,
                      verString,
                      '0.0.1' )
                      
    def testGetVersionNoAddendum( self ):
        verString = self.base.getVersionNoAddendum()
        assertEquals( 'Version string - no add' ,
                      verString,
                      '0.0.1' )
Example #6
0
class QueryTestCaseNoAddendum(unittest.TestCase):
    def setUp(self):
        self.base = Version('3.5.2')

    def testGetMajor(self):
        assertEquals('Major version number', self.base.getMajor(), 3)

    def testGetMinor(self):
        assertEquals('Minor version number', self.base.getMinor(), 5)

    def testGetPatch(self):
        assertEquals('Patch level', self.base.getPatch(), 2)

    def testGetAddendum(self):
        assertEquals('Addendum', self.base.getAddendum(), None)

    def testPrintVersion(self):
        verString = "%s" % self.base
        assertEquals('Version string', verString, '3.5.2')

    def testGetVersionNoAddendum(self):
        verString = self.base.getVersionNoAddendum()
        assertEquals('Version string - no add', verString, '3.5.2')
Example #7
0
class MixedVersionNumber(unittest.TestCase):
    def setUp(self):
        self.base = Version('2.4.4c1')

    def testGetMajor(self):
        assertEquals('Major version number', self.base.getMajor(), 2)

    def testGetMinor(self):
        assertEquals('Minor version number', self.base.getMinor(), 4)

    def testGetPatch(self):
        assertEquals('Patch level', self.base.getPatch(), 4)

    def testGetAddendum(self):
        assertEquals('Addendum', self.base.getAddendum(), 'c1')

    def testPrintVersion(self):
        verString = "%s" % self.base
        assertEquals('Version string', verString, '2.4.4-c1')

    def testGetVersionNoAddendum(self):
        verString = self.base.getVersionNoAddendum()
        assertEquals('Version string - no add', verString, '2.4.4')
Example #8
0
class TwoDigit(unittest.TestCase):
    def setUp(self):
        self.base = Version('6.4-foob')

    def testGetMajor(self):
        assertEquals('Major version number', self.base.getMajor(), 6)

    def testGetMinor(self):
        assertEquals('Minor version number', self.base.getMinor(), 4)

    def testGetPatch(self):
        assertEquals('Patch level', self.base.getPatch(), 0)

    def testGetAddendum(self):
        assertEquals('Addendum', self.base.getAddendum(), 'foob')

    def testPrintVersion(self):
        verString = "%s" % self.base
        assertEquals('Version string', verString, '6.4-foob')

    def testGetVersionNoAddendum(self):
        verString = self.base.getVersionNoAddendum()
        assertEquals('Version string - no add', verString, '6.4')
Example #9
0
class TwoDashAdd(unittest.TestCase):
    def setUp(self):
        self.base = Version('3.2.1-devel-test-twodash')

    def testGetMajor(self):
        assertEquals('Major version number', self.base.getMajor(), 3)

    def testGetMinor(self):
        assertEquals('Minor version number', self.base.getMinor(), 2)

    def testGetPatch(self):
        assertEquals('Patch level', self.base.getPatch(), 1)

    def testGetAddendum(self):
        assertEquals('Addendum', self.base.getAddendum(), 'devel-test-twodash')

    def testPrintVersion(self):
        verString = "%s" % self.base
        assertEquals('Version string', verString, '3.2.1-devel-test-twodash')

    def testGetVersionNoAddendum(self):
        verString = self.base.getVersionNoAddendum()
        assertEquals('Version string - no add', verString, '3.2.1')
Example #10
0
class FirstDigitZero(unittest.TestCase):
    def setUp(self):
        self.base = Version('0.0.1')

    def testGetMajor(self):
        assertEquals('Major version number', self.base.getMajor(), 0)

    def testGetMinor(self):
        assertEquals('Minor version number', self.base.getMinor(), 0)

    def testGetPatch(self):
        assertEquals('Patch level', self.base.getPatch(), 1)

    def testGetAddendum(self):
        assertEquals('Addendum', self.base.getAddendum(), None)

    def testPrintVersion(self):
        verString = "%s" % self.base
        assertEquals('Version string', verString, '0.0.1')

    def testGetVersionNoAddendum(self):
        verString = self.base.getVersionNoAddendum()
        assertEquals('Version string - no add', verString, '0.0.1')