Conditions | 1 |
Total Lines | 19 |
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 | 'username': '', |
||
27 | 'host_info': ['10.0.2.1', '135'], |
||
28 | 'ip': '', |
||
29 | 'password': '', |
||
30 | 'port': '22', |
||
31 | 'community': 'test', |
||
32 | 'test': True, |
||
33 | 'callback': mock_callback.callback |
||
34 | } |
||
35 | |||
36 | action.run(**kwargs) |
||
37 | |||
38 | expected_xml = """<config><snmp-server xmlns="urn:brocade.com:mgmt:brocade-snmp"><host operation="delete"><ip>10.0.2.1</ip><community>test</community><udp-port>135</udp-port></host></snmp-server></config>""" |
||
39 | |||
40 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
41 |