Total Complexity | 1 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import xml.etree.ElementTree as ET |
||
19 | class Testbgp_remove_bgp(BaseActionTestCase): |
||
20 | action_cls = bgp_remove_bgp |
||
21 | |||
22 | def test_action(self): |
||
23 | action = self.get_action_instance() |
||
24 | mock_callback = MockCallback() |
||
25 | kwargs = { |
||
26 | 'username': '', |
||
27 | 'rbridge_id': '224', |
||
28 | 'ip': '', |
||
29 | 'password': '', |
||
30 | 'port': '22', |
||
31 | 'vrf': 'test', |
||
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><router><bgp operation="delete" xmlns="urn:brocade.com:mgmt:brocade-bgp"><vrf-name>test</vrf-name></bgp></router></rbridge-id></config>""" |
||
39 | |||
40 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
41 |