Exemple #1
0
 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)
Exemple #2
0
 def testPipToIP(self):
     ''' Test conversion pip --> ip '''
     pip = inet.str_to_pip(self.ps)
     self.assertEqual(inet.pip_to_ip(pip), 16909060)
Exemple #3
0
 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')
Exemple #4
0
 def testStrToPip(self):
     ''' Test conversion str --> pip '''
     self.assertEqual(inet.str_to_pip(self.ps), '\x01\x02\x03\x04')
Exemple #5
0
 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)
Exemple #6
0
 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')
Exemple #7
0
 def testPipToIP(self):
     ''' Test conversion pip --> ip '''
     pip = inet.str_to_pip(self.ps)
     self.assertEqual(inet.pip_to_ip(pip), 16909060)
Exemple #8
0
 def testStrToPip(self):
     ''' Test conversion str --> pip '''
     self.assertEqual(inet.str_to_pip(self.ps), '\x01\x02\x03\x04')