Conditions | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import xml.etree.ElementTree as ET |
||
22 | def test_action(self): |
||
23 | action = self.get_action_instance() |
||
24 | mock_callback = MockCallback() |
||
25 | kwargs = { |
||
26 | 'count': '3', |
||
27 | 'username': '', |
||
28 | 'rbridge_id': '224', |
||
29 | 'get': 'False', |
||
30 | 'ip': '', |
||
31 | 'vrf': 'test', |
||
32 | 'neighbor': '10.0.2.1', |
||
33 | 'password': '', |
||
34 | 'port': '22', |
||
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><router-bgp-attributes><neighbor-ips><neighbor-addr><router-bgp-neighbor-address>10.0.2.1</router-bgp-neighbor-address><ebgp-multihop><ebgp-multihop-count>3</ebgp-multihop-count></ebgp-multihop></neighbor-addr></neighbor-ips></router-bgp-attributes></router-bgp-cmds-holder></bgp></router></rbridge-id></config>""" |
||
42 | |||
43 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
44 |