Fix junos unit test failures (#26676)

*  Use lxml api's in unit test to parse xml
*  Remove unwanted import in unit test
*  Add ncclient dependency in unit test requirement
This commit is contained in:
Ganesh Nalawade 2017-07-12 21:06:16 +05:30 committed by Matt Clay
parent db5ec11758
commit e14e37ee1e
8 changed files with 20 additions and 19 deletions

View file

@ -22,7 +22,10 @@ __metaclass__ = type
import os
import json
import xml.etree.ElementTree as ET
try:
from lxml.etree import parse
except ImportError:
from xml.etree.ElementTree import parse
from ansible.compat.tests import unittest
from ansible.compat.tests.mock import patch
@ -52,7 +55,7 @@ def load_fixture(name, content='xml'):
pass
else:
try:
data = ET.parse(path).getroot()
data = parse(path).getroot()
except:
pass