File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -85,20 +85,19 @@ def testHostName(self):
8585 self .assertEqual (host , host .lower ())
8686
8787 def testLocalIP (self ):
88- ip_local = localIP ()
89- self .assertTrue (ip_local )
90- self .assertFalse (ip_local .startswith ('127.' ))
91- self .assertEqual (localIP (), ip_local ) # second invocation
92- self .assertEqual (localIP (useCache = None ), ip_local )
88+ thisIp = localIP ()
89+ self .assertTrue (thisIp )
90+ self .assertFalse (thisIp .startswith ('127.' ))
91+ self .assertEqual (localIP (), thisIp ) # second invocation
92+ self .assertEqual (localIP (useCache = None ), thisIp )
9393
94- def assert_local (ip ):
94+ def assertLocal (ip ):
9595 self .assertTrue (
96- ip == ip_local or ip .startswith (('127.' , '192.168.' ))
96+ ip == thisIp or ip .startswith (('127.' , '192.168.' ))
9797 or '172.16.' <= ip <= '172.31.' )
9898
99- assert_local (localIP (remote = None , useCache = None ))
100- assert_local (
101- localIP (remote = ('www.hostname.and.domain.are.invalid' , 80 ),
99+ assertLocal (localIP (remote = None , useCache = None ))
100+ assertLocal (localIP (remote = ('www.hostname.and.domain.are.invalid' , 80 ),
102101 useCache = None ))
103102
104103 def testPositiveId (self ):
You can’t perform that action at this time.
0 commit comments