| Total Complexity | 1 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """Generated test for checking pynos based actions |
||
| 24 | class TestBgpGracefulRestart(BaseActionTestCase): |
||
| 25 | """Test holder class |
||
| 26 | """ |
||
| 27 | action_cls = bgp_graceful_restart |
||
| 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 | 'rbridge_id': '224', |
||
| 37 | 'get': False, |
||
| 38 | 'ip': '', |
||
| 39 | 'vrf': 'test', |
||
| 40 | 'password': '', |
||
| 41 | 'port': '22', |
||
| 42 | 'afi': 'ipv4', |
||
| 43 | 'test': True, |
||
| 44 | 'callback': mock_callback.callback |
||
| 45 | } |
||
| 46 | |||
| 47 | action.run(**kwargs) |
||
| 48 | |||
| 49 | expected_xml = ( |
||
| 50 | '<config><rbridge-id xmlns="urn:brocade.com:mgmt:brocade-rbridge">' |
||
| 51 | '<rbridge-id>224</rbridge-id><router><bgp xmlns="urn:brocade.com:m' |
||
| 52 | 'gmt:brocade-bgp"><vrf-name>test</vrf-name><router-bgp-cmds-holder' |
||
| 53 | '><address-family><ipv4><ipv4-unicast><af-common-cmds-holder><grac' |
||
| 54 | 'eful-restart><graceful-restart-status /></graceful-restart></af-c' |
||
| 55 | 'ommon-cmds-holder></ipv4-unicast></ipv4></address-family></router' |
||
| 56 | '-bgp-cmds-holder></bgp></router></rbridge-id></config>' |
||
| 57 | ) |
||
| 58 | |||
| 59 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
| 60 |