| Total Complexity | 1 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import xml.etree.ElementTree as ET |
||
| 19 | class Testbgp_max_paths(BaseActionTestCase): |
||
| 20 | action_cls = bgp_max_paths |
||
| 21 | |||
| 22 | def test_action(self): |
||
| 23 | action = self.get_action_instance() |
||
| 24 | mock_callback = MockCallback() |
||
| 25 | kwargs = { |
||
| 26 | 'username': '', |
||
| 27 | 'paths': '10', |
||
| 28 | 'afi': 'ipv4', |
||
| 29 | 'get': 'False', |
||
| 30 | 'ip': '', |
||
| 31 | 'vrf': 'test', |
||
| 32 | 'password': '', |
||
| 33 | 'port': '22', |
||
| 34 | 'rbridge_id': '224', |
||
| 35 | 'test': True, |
||
| 36 | 'callback': mock_callback.callback |
||
| 37 | } |
||
| 38 | |||
| 39 | action.run(**kwargs) |
||
| 40 | |||
| 41 | expected_xml = """<config><rbridge-id xmlns="urn:brocade.com:mgmt:brocade-rbridge"><rbridge-id>224</rbridge-id><router><bgp xmlns="urn:brocade.com:mgmt:brocade-bgp"><vrf-name>test</vrf-name><router-bgp-cmds-holder><address-family><ipv4><ipv4-unicast><af-common-cmds-holder><maximum-paths><load-sharing-value>10</load-sharing-value></maximum-paths></af-common-cmds-holder></ipv4-unicast></ipv4></address-family></router-bgp-cmds-holder></bgp></router></rbridge-id></config>""" |
||
| 42 | |||
| 43 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 44 |