| Total Complexity | 1 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import xml.etree.ElementTree as ET |
||
| 19 | class Testsystem_router_id(BaseActionTestCase): |
||
| 20 | action_cls = system_router_id |
||
| 21 | |||
| 22 | def test_action(self): |
||
| 23 | action = self.get_action_instance() |
||
| 24 | mock_callback = MockCallback() |
||
| 25 | kwargs = { |
||
| 26 | 'router_id': '4', |
||
| 27 | 'username': '', |
||
| 28 | 'rbridge_id': '224', |
||
| 29 | 'ip': '', |
||
| 30 | 'password': '', |
||
| 31 | 'port': '22', |
||
| 32 | 'test': True, |
||
| 33 | 'callback': mock_callback.callback |
||
| 34 | } |
||
| 35 | |||
| 36 | action.run(**kwargs) |
||
| 37 | |||
| 38 | expected_xml = """<config><rbridge-id xmlns="urn:brocade.com:mgmt:brocade-rbridge"><rbridge-id>224</rbridge-id><ip><rtm-config xmlns="urn:brocade.com:mgmt:brocade-rtm"><router-id>4</router-id></rtm-config></ip></rbridge-id></config>""" |
||
| 39 | |||
| 40 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 41 |