File: test_hpcomware.py

package info (click to toggle)
python-ncclient 0.6.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,448 kB
  • sloc: python: 9,548; xml: 476; makefile: 77; sh: 5
file content (28 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest
from ncclient.devices.hpcomware import *
from ncclient.xml_ import *


class TestHpcomwareDevice(unittest.TestCase):

    def setUp(self):
        self.obj = HpcomwareDeviceHandler({'name': 'hpcomware'})

    def test_get_xml_base_namespace_dict(self):
        expected = {None: BASE_NS_1_0}
        self.assertDictEqual(expected, self.obj.get_xml_base_namespace_dict())

    def test_get_xml_extra_prefix_kwargs(self):
        expected = {'nsmap': {'data': 'http://www.hp.com/netconf/data:1.0',
                              'config': 'http://www.hp.com/netconf/config:1.0',
                              None: 'urn:ietf:params:xml:ns:netconf:base:1.0'}}
        self.assertDictEqual(expected, self.obj.get_xml_extra_prefix_kwargs())

    def test_add_additional_operations(self):
        expected = dict()
        expected['cli_display'] = DisplayCommand
        expected['cli_config'] = ConfigCommand
        expected['action'] = Action
        expected['save'] = Save
        expected['rollback'] = Rollback
        self.assertDictEqual(expected, self.obj.add_additional_operations())