<s> import unittest <EOL> from hazelcast . core import Address , Member <EOL> from hazelcast . util import get_possible_addresses <EOL> class AddressTest ( unittest . TestCase ) : <EOL> def test_no_given_address ( self ) : <EOL> addresses = get_possible_addresses ( [ ] ) <EOL> self . assertItemsEqual ( addresses , <EOL> [ Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) , Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) , Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) ] ) <EOL> def test_single_given_address_with_no_port ( self ) : <EOL> addresses = [ "<STR_LIT:127.0.0.1>" ] <EOL> addresses = get_possible_addresses ( addresses ) <EOL> self . assertItemsEqual ( addresses , <EOL> [ Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) , Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) , Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) ] ) <EOL> def test_single_address_and_port ( self ) : <EOL> addresses = [ "<STR_LIT>" ] <EOL> addresses = get_possible_addresses ( addresses ) <EOL> self . assertItemsEqual ( addresses , [ Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) ] ) <EOL> def test_multiple_addresses ( self ) : <EOL> addresses = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> addresses = get_possible_addresses ( addresses ) <EOL> self . assertItemsEqual ( addresses , <EOL> [ Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) , Address ( "<STR_LIT>" , <NUM_LIT> ) , Address ( "<STR_LIT>" , <NUM_LIT> ) , <EOL> Address ( "<STR_LIT>" , <NUM_LIT> ) ] ) <EOL> def test_multiple_addresses_non_unique ( self ) : <EOL> addresses = [ "<STR_LIT>" , "<STR_LIT>" ] <EOL> addresses = get_possible_addresses ( addresses ) <EOL> self . assertItemsEqual ( addresses , [ Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) ] ) <EOL> def test_addresses_and_members ( self ) : <EOL> addresses = [ "<STR_LIT>" ] <EOL> member_list = [ Member ( Address ( "<STR_LIT>" , <NUM_LIT> ) , "<STR_LIT>" ) , Member ( Address ( "<STR_LIT>" , <NUM_LIT> ) , "<STR_LIT>" ) ] <EOL> addresses = get_possible_addresses ( addresses , member_list ) <EOL> self . assertItemsEqual ( addresses , <EOL> [ Address ( "<STR_LIT:127.0.0.1>" , <NUM_LIT> ) , Address ( "<STR_LIT>" , <NUM_LIT> ) , Address ( "<STR_LIT>" , <NUM_LIT> ) ] ) </s>
