| Conditions | 1 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | """Generated test for checking pynos based actions |
||
| 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 | 'name': '10/0/44', |
||
| 37 | 'int_type': 'tengigabitethernet', |
||
| 38 | 'ip': '', |
||
| 39 | 'password': '', |
||
| 40 | 'port': '22', |
||
| 41 | 'mtu': '1500', |
||
| 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/44</name><ip><ip-config xmlns="ur' |
||
| 51 | 'n:brocade.com:mgmt:brocade-ip-config"><mtu>1500</mtu></ip-config>' |
||
| 52 | '</ip></tengigabitethernet></interface></config>' |
||
| 53 | ) |
||
| 54 | |||
| 55 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 56 |