| Total Complexity | 1 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """Generated test for checking pynos based actions |
||
| 24 | class TestInterfaceDelIp(BaseActionTestCase): |
||
| 25 | """Test holder class |
||
| 26 | """ |
||
| 27 | action_cls = interface_del_ip |
||
| 28 | |||
| 29 | def test_action(self): |
||
| 30 | """Generated test to check action |
||
| 31 | """ |
||
| 32 | action = self.get_action_instance() |
||
| 33 | mock_callback = MockCallback() |
||
| 34 | kwargs = { |
||
| 35 | 'username': '', |
||
| 36 | 'password': '', |
||
| 37 | 'ip_addr': '10.10.0.1/24', |
||
| 38 | 'inter_type': 'tengigabitethernet', |
||
| 39 | 'ip': '', |
||
| 40 | 'inter': '10/0/1', |
||
| 41 | 'port': '22', |
||
| 42 | 'test': True, |
||
| 43 | 'callback': mock_callback.callback |
||
| 44 | } |
||
| 45 | |||
| 46 | action.run(**kwargs) |
||
| 47 | |||
| 48 | expected_xml = ( |
||
| 49 | '<config><interface xmlns="urn:brocade.com:mgmt:brocade-interface"' |
||
| 50 | '><tengigabitethernet><name>10/0/1</name><ip><ip-config xmlns="urn' |
||
| 51 | ':brocade.com:mgmt:brocade-ip-config"><address operation="delete">' |
||
| 52 | '<address>10.10.0.1/24</address></address></ip-config></ip></tengi' |
||
| 53 | 'gabitethernet></interface></config>' |
||
| 54 | ) |
||
| 55 | |||
| 56 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 57 |