def test_bridge_ip_transports_line(self): """ Parses the 'bridge-ip-transports' line, which only appears in bridges. """ desc = BridgeExtraInfoDescriptor.create({'bridge-ip-transports': '<OR>=16,<??>=40'}) self.assertEqual({'<OR>': 16, '<??>': 40}, desc.ip_transports) desc = BridgeExtraInfoDescriptor.create({'bridge-ip-transports': ''}) self.assertEqual({}, desc.ip_transports) desc_text = BridgeExtraInfoDescriptor.content({'bridge-ip-transports': '<OR>=24.5'}) self.assertRaises(ValueError, RelayExtraInfoDescriptor, desc_text, True)
def test_bridge_ip_transports_line(self): """ Parses the 'bridge-ip-transports' line, which only appears in bridges. """ desc = BridgeExtraInfoDescriptor.create({'bridge-ip-transports': '<OR>=16,<??>=40'}) self.assertEqual({'<OR>': 16, '<??>': 40}, desc.ip_transports) desc = BridgeExtraInfoDescriptor.create({'bridge-ip-transports': ''}) self.assertEqual({}, desc.ip_transports) desc_text = BridgeExtraInfoDescriptor.content({'bridge-ip-transports': '<OR>=24.5'}) self.assertRaises(ValueError, RelayExtraInfoDescriptor, desc_text, True)
def test_bridge_ip_versions_line(self): """ Parses the 'bridge-ip-versions' line, which only appears in bridges. """ desc = BridgeExtraInfoDescriptor.create({'bridge-ip-versions': 'v4=16,v6=40'}) self.assertEqual({'v4': 16, 'v6': 40}, desc.ip_versions) desc = BridgeExtraInfoDescriptor.create({'bridge-ip-versions': ''}) self.assertEqual({}, desc.ip_versions) desc_text = BridgeExtraInfoDescriptor.content({'bridge-ip-versions': 'v4=24.5'}) self.assertRaises(ValueError, RelayExtraInfoDescriptor, desc_text, True)
def test_bridge_ip_versions_line(self): """ Parses the 'bridge-ip-versions' line, which only appears in bridges. """ desc = BridgeExtraInfoDescriptor.create({'bridge-ip-versions': 'v4=16,v6=40'}) self.assertEqual({'v4': 16, 'v6': 40}, desc.ip_versions) desc = BridgeExtraInfoDescriptor.create({'bridge-ip-versions': ''}) self.assertEqual({}, desc.ip_versions) desc_text = BridgeExtraInfoDescriptor.content({'bridge-ip-versions': 'v4=24.5'}) self.assertRaises(ValueError, RelayExtraInfoDescriptor, desc_text, True)