<s> """<STR_LIT>""" <EOL> import unittest <EOL> class AddrTest ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> from certbot_nginx . obj import Addr <EOL> self . addr1 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . addr2 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . addr3 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . addr4 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . addr5 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . addr6 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . addr7 = Addr . fromstring ( "<STR_LIT>" ) <EOL> def test_fromstring ( self ) : <EOL> self . assertEqual ( self . addr1 . get_addr ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( self . addr1 . get_port ( ) , "<STR_LIT>" ) <EOL> self . assertFalse ( self . addr1 . ssl ) <EOL> self . assertFalse ( self . addr1 . default ) <EOL> self . assertEqual ( self . addr2 . get_addr ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( self . addr2 . get_port ( ) , "<STR_LIT:*>" ) <EOL> self . assertTrue ( self . addr2 . ssl ) <EOL> self . assertFalse ( self . addr2 . default ) <EOL> self . assertEqual ( self . addr3 . get_addr ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( self . addr3 . get_port ( ) , "<STR_LIT>" ) <EOL> self . assertFalse ( self . addr3 . ssl ) <EOL> self . assertFalse ( self . addr3 . default ) <EOL> self . assertEqual ( self . addr4 . get_addr ( ) , "<STR_LIT:*>" ) <EOL> self . assertEqual ( self . addr4 . get_port ( ) , "<STR_LIT>" ) <EOL> self . assertTrue ( self . addr4 . ssl ) <EOL> self . assertTrue ( self . addr4 . default ) <EOL> self . assertEqual ( self . addr5 . get_addr ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( self . addr5 . get_port ( ) , "<STR_LIT>" ) <EOL> self . assertFalse ( self . addr5 . ssl ) <EOL> self . assertFalse ( self . addr5 . default ) <EOL> self . assertEqual ( self . addr6 . get_addr ( ) , "<STR_LIT>" ) <EOL> self . assertEqual ( self . addr6 . get_port ( ) , "<STR_LIT>" ) <EOL> self . assertFalse ( self . addr6 . ssl ) <EOL> self . assertTrue ( self . addr6 . default ) <EOL> self . assertEqual ( None , self . addr7 ) <EOL> def test_str ( self ) : <EOL> self . assertEqual ( str ( self . addr1 ) , "<STR_LIT>" ) <EOL> self . assertEqual ( str ( self . addr2 ) , "<STR_LIT>" ) <EOL> self . assertEqual ( str ( self . addr3 ) , "<STR_LIT>" ) <EOL> self . assertEqual ( str ( self . addr4 ) , "<STR_LIT>" ) <EOL> self . assertEqual ( str ( self . addr5 ) , "<STR_LIT>" ) <EOL> self . assertEqual ( str ( self . addr6 ) , "<STR_LIT>" ) <EOL> def test_eq ( self ) : <EOL> from certbot_nginx . obj import Addr <EOL> new_addr1 = Addr . fromstring ( "<STR_LIT>" ) <EOL> self . assertEqual ( self . addr1 , new_addr1 ) <EOL> self . assertNotEqual ( self . addr1 , self . addr2 ) <EOL> self . assertFalse ( self . addr1 == <NUM_LIT> ) <EOL> def test_set_inclusion ( self ) : <EOL> from certbot_nginx . obj import Addr <EOL> set_a = set ( [ self . addr1 , self . addr2 ] ) <EOL> addr1b = Addr . fromstring ( "<STR_LIT>" ) <EOL> addr2b = Addr . fromstring ( "<STR_LIT>" ) <EOL> set_b = set ( [ addr1b , addr2b ] ) <EOL> self . assertEqual ( set_a , set_b ) <EOL> class VirtualHostTest ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> from certbot_nginx . obj import VirtualHost <EOL> from certbot_nginx . obj import Addr <EOL> self . vhost1 = VirtualHost ( <EOL> "<STR_LIT>" , <EOL> set ( [ Addr . fromstring ( "<STR_LIT:localhost>" ) ] ) , False , False , <EOL> set ( [ '<STR_LIT:localhost>' ] ) , [ ] ) <EOL> def test_eq ( self ) : <EOL> from certbot_nginx . obj import Addr <EOL> from certbot_nginx . obj import VirtualHost <EOL> vhost1b = VirtualHost ( <EOL> "<STR_LIT>" , <EOL> set ( [ Addr . fromstring ( "<STR_LIT>" ) ] ) , False , False , <EOL> set ( [ '<STR_LIT:localhost>' ] ) , [ ] ) <EOL> self . assertEqual ( vhost1b , self . vhost1 ) <EOL> self . assertEqual ( str ( vhost1b ) , str ( self . vhost1 ) ) <EOL> self . assertFalse ( vhost1b == <NUM_LIT> ) <EOL> def test_str ( self ) : <EOL> stringified = '<STR_LIT:\n>' . join ( [ '<STR_LIT>' , '<STR_LIT>' , <EOL> "<STR_LIT>" , '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertEqual ( stringified , str ( self . vhost1 ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
