mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
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:
committed by
Matt Clay
parent
db5ec11758
commit
e14e37ee1e
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user