<s> import unittest <EOL> import socket <EOL> from thespian . system . transport . IPBase import * <EOL> cmpTCP = lambda a , b : thisSystem . cmpIP2Tuple ( socket . AF_INET , socket . SOCK_STREAM , socket . IPPROTO_TCP , a , b ) <EOL> class IP2TupleTests ( unittest . TestCase ) : <EOL> scope = '<STR_LIT>' <EOL> def setUp ( self ) : <EOL> self . myAddrs = [ rslt [ <NUM_LIT:4> ] [ <NUM_LIT:0> ] <EOL> for usage in [ <NUM_LIT:0> , socket . AI_PASSIVE ] <EOL> for useAddr in [ None , socket . gethostname ( ) , socket . getfqdn ( ) ] <EOL> for rslt in socket . getaddrinfo ( useAddr , <NUM_LIT:0> , socket . AF_INET , <EOL> socket . SOCK_STREAM , <EOL> socket . IPPROTO_TCP , usage ) <EOL> ] <EOL> print ( self . myAddrs ) <EOL> def test_eq01 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq02 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:0> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq03 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , None ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq04 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:0> ) ) ) <EOL> def test_eq05 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , None ) ) ) <EOL> def test_eq06 ( self ) : self . assertTrue ( cmpTCP ( ( None , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq07 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT>' , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq08 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT>' , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq09 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( None , <NUM_LIT:32> ) ) ) <EOL> def test_eq10 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq11 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_ne12 ( self ) : self . assertFalse ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT> ) ) ) <EOL> def test_ne13 ( self ) : self . assertFalse ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_ne14 ( self ) : self . assertFalse ( cmpTCP ( ( '<STR_LIT>' , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_ne15 ( self ) : self . assertFalse ( cmpTCP ( ( '<STR_LIT>' , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_ne16 ( self ) : self . assertFalse ( cmpTCP ( ( None , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq17 ( self ) : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT> ) , ( '<STR_LIT>' , <NUM_LIT> ) ) ) <EOL> def test_eq21 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:32> ) , ( each , <NUM_LIT:32> ) ) ) <EOL> def test_eq22 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:0> ) , ( each , <NUM_LIT:32> ) ) ) <EOL> def test_eq23 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( '<STR_LIT:127.0.0.1>' , None ) , ( each , <NUM_LIT:32> ) ) ) <EOL> def test_eq24 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , <NUM_LIT:0> ) ) ) <EOL> def test_eq25 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( '<STR_LIT:127.0.0.1>' , None ) ) ) <EOL> def test_eq26 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( None , <NUM_LIT:32> ) , ( each , <NUM_LIT:32> ) ) ) <EOL> def test_eq27 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( '<STR_LIT>' , <NUM_LIT:32> ) , ( each , <NUM_LIT:32> ) ) ) <EOL> def test_eq28 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( '<STR_LIT>' , <NUM_LIT:32> ) , ( each , <NUM_LIT:32> ) ) ) <EOL> def test_eq29 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( None , <NUM_LIT:32> ) ) ) <EOL> def test_eq30 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_eq31 ( self ) : <EOL> for each in self . myAddrs : self . assertTrue ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) <EOL> def test_ne32 ( self ) : <EOL> for each in self . myAddrs : self . assertFalse ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT> ) ) ) <EOL> def test_ne33 ( self ) : <EOL> for each in self . myAddrs : self . assertFalse ( cmpTCP ( ( each , <NUM_LIT:32> ) , ( '<STR_LIT>' , <NUM_LIT:32> ) ) ) </s>
