示例#1
0
 def test_exact_ip(self):
     ipr1 = IPRange(ip_from='127.0.0.1')
     self.assertTrue(ipr1.in_range('127.0.0.1'))
     self.assertFalse(ipr1.in_range('127.0.0.0'))
     self.assertFalse(ipr1.in_range('127.0.0.2'))
     self.assertFalse(ipr1.in_range('255.255.255.255'))
示例#2
0
 def test_100_to_end(self):
     ipr1 = IPRange(ip_from='100.1.1.1', ip_to='255.255.255.255')
     self.assertTrue(ipr1.in_range('127.0.0.1'))
示例#3
0
 def test_all_the_range(self):
     ipr1 = IPRange(ip_from='0.0.0.0', ip_to='255.255.255.255')
     self.assertTrue(ipr1.in_range('127.0.0.1'))
示例#4
0
文件: tests.py 项目: 66ru/smsgate
 def test_exact_ip(self):
     ipr1 = IPRange(ip_from='127.0.0.1')
     self.assertTrue(ipr1.in_range('127.0.0.1'))
     self.assertFalse(ipr1.in_range('127.0.0.0'))
     self.assertFalse(ipr1.in_range('127.0.0.2'))
     self.assertFalse(ipr1.in_range('255.255.255.255'))
示例#5
0
文件: tests.py 项目: 66ru/smsgate
 def test_100_to_end(self):
     ipr1 = IPRange(ip_from='100.1.1.1', ip_to='255.255.255.255')
     self.assertTrue(ipr1.in_range('127.0.0.1'))
示例#6
0
文件: tests.py 项目: 66ru/smsgate
 def test_all_the_range(self):
     ipr1 = IPRange(ip_from='0.0.0.0', ip_to='255.255.255.255')
     self.assertTrue(ipr1.in_range('127.0.0.1'))