| Total Complexity | 1 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """Generated test for checking pynos based actions |
||
| 24 | class TestSnmpDelSnmpHost(BaseActionTestCase): |
||
| 25 | """Test holder class |
||
| 26 | """ |
||
| 27 | action_cls = snmp_del_snmp_host |
||
| 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 | 'host_info': ['10.0.2.1', '135'], |
||
| 37 | 'ip': '', |
||
| 38 | 'password': '', |
||
| 39 | 'port': '22', |
||
| 40 | 'community': 'test', |
||
| 41 | 'test': True, |
||
| 42 | 'callback': mock_callback.callback |
||
| 43 | } |
||
| 44 | |||
| 45 | action.run(**kwargs) |
||
| 46 | |||
| 47 | expected_xml = ( |
||
| 48 | '<config><snmp-server xmlns="urn:brocade.com:mgmt:brocade-snmp"><h' |
||
| 49 | 'ost operation="delete"><ip>10.0.2.1</ip><community>test</communit' |
||
| 50 | 'y><udp-port>135</udp-port></host></snmp-server></config>' |
||
| 51 | ) |
||
| 52 | |||
| 53 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 54 |