def testConversion(self): """ intAdlerToHex and hexAdlerToInt tests """ # no arguments try: Adler.intAdlerToHex() except Exception, error: self.assertEqual(isinstance(error, TypeError), True)
def testConversion( self ): """ intAdlerToHex and hexAdlerToInt tests """ # no arguments try: Adler.intAdlerToHex() #pylint: disable=no-value-for-parameter except Exception, error: self.assertEqual( isinstance(error, TypeError), True )
def testConversion(self): """ intAdlerToHex and hexAdlerToInt tests """ # no arguments try: Adler.intAdlerToHex() #pylint: disable=no-value-for-parameter except Exception, error: self.assertEqual(isinstance(error, TypeError), True)
def testConversion( self ): """ intAdlerToHex and hexAdlerToInt tests """ # no arguments try: Adler.intAdlerToHex() except Exception, error: self.assertEqual( isinstance(error, TypeError), True )
def testConversion(self): """intAdlerToHex and hexAdlerToInt tests""" # no arguments try: Adler.intAdlerToHex() # pylint: disable=no-value-for-parameter except Exception as error: self.assertEqual(isinstance(error, TypeError), True) # wrong type of arg (should it really print out to stdout) self.assertEqual(Adler.intAdlerToHex("a"), False) # normal operation self.assertEqual(int(Adler.intAdlerToHex(1)), Adler.hexAdlerToInt(Adler.intAdlerToHex(1))) self.assertEqual(Adler.hexAdlerToInt("0x01"), int(Adler.intAdlerToHex(Adler.hexAdlerToInt("0x01"))))
# wrong argument type self.assertEqual( Adler.stringAdler([]), False ) # empty string self.assertEqual( int(Adler.stringAdler("")), int(self.emptyAdler) ) # all letters self.assertEqual( Adler.stringAdler(string.letters), self.lettersAdler ) def testConversion( self ): """ intAdlerToHex and hexAdlerToInt tests """ # no arguments try: Adler.intAdlerToHex() #pylint: disable=no-value-for-parameter except Exception, error: self.assertEqual( isinstance(error, TypeError), True ) # wrong type of arg (should it really print out to stdout) self.assertEqual( Adler.intAdlerToHex("a"), False ) # normal operation self.assertEqual( int(Adler.intAdlerToHex(1)), Adler.hexAdlerToInt( Adler.intAdlerToHex(1) ) ) self.assertEqual( Adler.hexAdlerToInt( "0x01" ), int( Adler.intAdlerToHex( Adler.hexAdlerToInt( "0x01" ) ) ) ) def testFileAdler( self ): """ fileAdler tests """ # no args try: Adler.fileAdler() #pylint: disable=no-value-for-parameter except Exception as error: self.assertEqual( isinstance(error,TypeError ), True ) # read-protected file self.assertEqual( Adler.fileAdler( "/root/.login" ), False )
# wrong argument type self.assertEqual(Adler.stringAdler([]), False) # empty string self.assertEqual(int(Adler.stringAdler("")), int(self.emptyAdler)) # all letters self.assertEqual(Adler.stringAdler(string.letters), self.lettersAdler) def testConversion(self): """ intAdlerToHex and hexAdlerToInt tests """ # no arguments try: Adler.intAdlerToHex() except Exception, error: self.assertEqual(isinstance(error, TypeError), True) # wrong type of arg (should it really print out to stdout) self.assertEqual(Adler.intAdlerToHex("a"), False) # normal operation self.assertEqual(int(Adler.intAdlerToHex(1)), Adler.hexAdlerToInt(Adler.intAdlerToHex(1))) self.assertEqual(Adler.hexAdlerToInt("0x01"), int(Adler.intAdlerToHex(Adler.hexAdlerToInt("0x01")))) def testFileAdler(self): """ fileAdler tests """ # no args try: Adler.fileAdler() except Exception as error: self.assertEqual(isinstance(error, TypeError), True) # read-protected file self.assertEqual(Adler.fileAdler("/root/.login"), False)