def __init__(self, **kwargs): super().__init__(**kwargs) self.add_module( LineCard(connector=Connector.RJ45, name='port', base=1, size=32)) self.add_port(Port(connector=Connector.RJ45, name='lan')) self.add_port(Port(connector=Connector.DB9, name='local'))
def __init__(self, **kwargs): super().__init__(**kwargs) self.add_port(Port(connector=Connector.RJ45, name='console')) self.add_port(Port(connector=Connector.RJ45, name='aux')) self.add_port(Port(connector=Connector.RJ45, name='mgt0')) self.add_port(Port(connector=Connector.RJ45, name='mgt1')) for i in range(0, 4): self.add_port( Port(connector=Connector.SFPPLUS, name='sfp+{}'.format(i)))
def __init__(self, **kwargs): super().__init__(**kwargs) self.add_port(Port(name='console', connector=Connector.RJ45)) # 48xSFP+ for i in range(0, 48): self.add_port( Port(name='Eth1/{}'.format(i), connector=Connector.SFPPLUS)) # 4xQSFP+ for i in range(48, 52): self.add_port( Port(name='Eth1/{}'.format(i), connector=Connector.QSFP))
def test_port_can_handle_sfp(self): p = Port(connector=Connector.SFPPLUS, name='port') p.set_transceiver(SFPPlus()) self.assertIs(type(p.get_transceiver()), SFPPlus) self.assertIsInstance(p.get_transceiver(), Transceiver)
def test_port_cant_handle_sfp(self): p = Port(connector=Connector.RJ45, name='port') self.assertRaises(CantHandleTransceiver, p.set_transceiver, SFPPlus())
def test_cant_connect_to_self(self): p = Port(connector=Connector.RJ45, name='port') self.assertRaises(SelfConnect, p.connect, p, UTPCat6Patch())
def __init__(self, **kwargs): super().__init__(**kwargs) self.add_port(Port(connector=Connector.DB9, name='console'))