Conditions | 1 |
Total Lines | 23 |
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 | 'name': '10/0/1', |
||
28 | 'ip': '', |
||
29 | 'port_int': '4', |
||
30 | 'channel_type': 'standard', |
||
31 | 'mode': 'active', |
||
32 | 'int_type': 'tengigabitethernet', |
||
33 | 'password': '', |
||
34 | 'port': '22', |
||
35 | 'delete': 'False', |
||
36 | 'test': True, |
||
37 | 'callback': mock_callback.callback |
||
38 | } |
||
39 | |||
40 | action.run(**kwargs) |
||
41 | |||
42 | expected_xml = """<config><interface xmlns="urn:brocade.com:mgmt:brocade-interface"><tengigabitethernet><name>10/0/1</name><channel-group><mode>active</mode><port-int>4</port-int><type>standard</type></channel-group></tengigabitethernet></interface></config>""" |
||
43 | |||
44 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
45 |