def test_inequality(self): layer_a = TransportAddress() layer_b = TransportAddress(high=2) assert_not_equals(layer_a, layer_b) layer_a.low = 2 layer_b.high = 65535 assert_not_equals(layer_a, layer_b)
def test_str(self): layer = TransportAddress() assert_equals(layer.__str__(), 'TCP/UDP 1-65535') layer.low = 3 assert_equals(layer.__str__(), 'TCP/UDP 3-65535') layer.high = 3 assert_equals(layer.__str__(), 'TCP/UDP 3') layer.high = 5 assert_equals(layer.__str__(), 'TCP/UDP 3-5')
def test_repr(self): layer = TransportAddress() assert_equals(layer.__repr__(), '<TransportAddress 1-65535>') layer.low = 3 assert_equals(layer.__repr__(), '<TransportAddress 3-65535>') layer.high = 3 assert_equals(layer.__repr__(), '<TransportAddress 3>') layer.high = 5 assert_equals(layer.__repr__(), '<TransportAddress 3-5>')
def test_setter(self): layer = TransportAddress() layer.low = 1 assert_equals(layer.low, 1) layer.high = 1 assert_equals(layer.high, 1)