| 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 | 'username': '', |
||
| 27 | 'ctag': '10-11', |
||
| 28 | 'name': '10/0/1', |
||
| 29 | 'ip': '', |
||
| 30 | 'vlan': '10', |
||
| 31 | 'int_type': 'tengigabitethernet', |
||
| 32 | 'action': 'add', |
||
| 33 | 'password': '', |
||
| 34 | 'port': '22', |
||
| 35 | 'test': True, |
||
| 36 | 'callback': mock_callback.callback |
||
| 37 | } |
||
| 38 | |||
| 39 | action.run(**kwargs) |
||
| 40 | |||
| 41 | expected_xml = """<config><interface xmlns="urn:brocade.com:mgmt:brocade-interface"><tengigabitethernet><name>10/0/1</name><switchport><trunk><trunk-vlan-classification><allowed><vlan><add><trunk-vlan-id>10</trunk-vlan-id><trunk-ctag-range>10-11</trunk-ctag-range></add></vlan></allowed></trunk-vlan-classification></trunk></switchport></tengigabitethernet></interface></config>""" |
||
| 42 | |||
| 43 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 44 |