test: fix a pylint

After commit 7594cef35f,
pylint show a "access to a protected member" warning.
This patch introduces a static method to solve it.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
This commit is contained in:
Chen Hanxiao 2014-04-10 23:15:55 +08:00
parent e0215dec61
commit 35c9afad45
2 changed files with 5 additions and 1 deletions

View File

@ -222,7 +222,7 @@ class TestCapabilities(unittest.TestCase):
test_utils(new_caps_no_kvm, False, True, False, False, False)
def testCPUMap(self):
_CPUMapFileValues._cpu_filename = "tests/capabilities-xml/cpu_map.xml"
_CPUMapFileValues.update_cpu_filename("tests/capabilities-xml/cpu_map.xml")
caps = self._buildCaps("libvirt-0.7.6-qemu-caps.xml")
cpu_64 = caps.get_cpu_values(None, "x86_64")
cpu_32 = caps.get_cpu_values(None, "i486")

View File

@ -113,6 +113,10 @@ class _CPUMapFileValues(_CPUAPIValues):
self._parseXML,
RuntimeError)
@staticmethod
def update_cpu_filename(name):
_CPUMapFileValues._cpu_filename = name
def _parseXML(self, node):
child = node.children
while child: