Total Complexity | 1 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | """Generated test for checking pynos based actions |
||
24 | class TestInterfaceTrunkAllowedVlan(BaseActionTestCase): |
||
25 | """Test holder class |
||
26 | """ |
||
27 | action_cls = interface_trunk_allowed_vlan |
||
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 | 'ctag': '10-11', |
||
37 | 'name': '10/0/1', |
||
38 | 'ip': '', |
||
39 | 'vlan': '10', |
||
40 | 'int_type': 'tengigabitethernet', |
||
41 | 'action': 'add', |
||
42 | 'password': '', |
||
43 | 'port': '22', |
||
44 | 'test': True, |
||
45 | 'callback': mock_callback.callback |
||
46 | } |
||
47 | |||
48 | action.run(**kwargs) |
||
49 | |||
50 | expected_xml = ( |
||
51 | '<config><interface xmlns="urn:brocade.com:mgmt:brocade-interface"' |
||
52 | '><tengigabitethernet><name>10/0/1</name><switchport><trunk><trunk' |
||
53 | '-vlan-classification><allowed><vlan><add><trunk-vlan-id>10</trunk' |
||
54 | '-vlan-id><trunk-ctag-range>10-11</trunk-ctag-range></add></vlan><' |
||
55 | '/allowed></trunk-vlan-classification></trunk></switchport></tengi' |
||
56 | 'gabitethernet></interface></config>' |
||
57 | ) |
||
58 | |||
59 | self.assertTrue(expected_xml, mock_callback.returned_data) |
||
60 |