def test_add_mixed_ports(self):
     group = TransportGroup()
     group.add(TransportAddress.from_string('1-3'))
     group.add(TcpAddress.from_string('1-3'))
     group.add(UdpAddress.from_string('1-3'))
     assert_equals(len(group), 3)
Esempio n. 2
0
 def from_string(value):
     transport_address = TransportAddress.from_string(value)
     transport_group = TransportGroup()
     transport_group.add(transport_address)
     return transport_group
 def test_from_string(self):
     from_string = TransportGroup.from_string
     group = from_string(1)
     assert_is_instance(group, TransportGroup)
     address = TransportAddress.from_string(1)
     assert_in(address, group)
 def test_contains_transport_string(self):
     layer = TransportAddress.from_string('1-2')
     assert_in('1-2', layer)
     assert_not_in('2-3', layer)
 def test_contains_transport_string(self):
     layer = TransportAddress.from_string('1-2')
     assert_in('1-2', layer)
     assert_not_in('2-3', layer)
Esempio n. 6
0
 def test_add_mixed_ports(self):
     group = TransportGroup()
     group.add(TransportAddress.from_string('1-3'))
     group.add(TcpAddress.from_string('1-3'))
     group.add(UdpAddress.from_string('1-3'))
     assert_equals(len(group), 3)
Esempio n. 7
0
 def test_from_string(self):
     from_string = TransportGroup.from_string
     group = from_string(1)
     assert_is_instance(group, TransportGroup)
     address = TransportAddress.from_string(1)
     assert_in(address, group)