def testIPToStr(self): ''' Test conversion ip --> str ''' ip = inet.pip_to_ip(inet.str_to_pip(self.ps)) self.assertEqual(inet.ip_to_str(ip), self.ps)
def testPipToIP(self): ''' Test conversion pip --> ip ''' pip = inet.str_to_pip(self.ps) self.assertEqual(inet.pip_to_ip(pip), 16909060)
def testIPToPip(self): ''' Test conversion ip --> pip ''' ip = inet.pip_to_ip(inet.str_to_pip(self.ps)) self.assertEqual(inet.ip_to_pip(ip), '\x01\x02\x03\x04')
def testStrToPip(self): ''' Test conversion str --> pip ''' self.assertEqual(inet.str_to_pip(self.ps), '\x01\x02\x03\x04')