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