Total Complexity | 1 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | import xml.etree.ElementTree as ET |
||
19 | class Testinterface_fabric_isl(BaseActionTestCase): |
||
20 | action_cls = interface_fabric_isl |
||
21 | |||
22 | def test_action(self): |
||
23 | action = self.get_action_instance() |
||
24 | mock_callback = MockCallback() |
||
25 | kwargs = { |
||
26 | 'username': '', |
||
27 | 'name': '10/0/2', |
||
28 | 'get': False, |
||
29 | 'ip': '', |
||
30 | 'enabled': True, |
||
31 | 'int_type': 'tengigabitethernet', |
||
32 | 'password': '', |
||
33 | 'port': '22', |
||
34 | 'test': True, |
||
35 | 'callback': mock_callback.callback |
||
36 | } |
||
37 | |||
38 | action.run(**kwargs) |
||
39 | |||
40 | expected_xml = """<config><interface xmlns="urn:brocade.com:mgmt:brocade-interface"><tengigabitethernet><name>10/0/2</name><fabric xmlns="urn:brocade.com:mgmt:brocade-fcoe"><fabric-isl><fabric-isl-enable /></fabric-isl></fabric></tengigabitethernet></interface></config>""" |
||
41 | |||
42 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
43 |