devices: graphics: Test remaining code coverage

This commit is contained in:
Cole Robinson 2019-06-10 16:09:02 -04:00
parent b0b3ba4e1c
commit c33eb562c2
2 changed files with 4 additions and 6 deletions

View File

@ -766,6 +766,9 @@ class XMLParseTest(unittest.TestCase):
self._alter_compare(guest.get_xml(), outfile)
# Call this for code coverage
self.assertTrue(bool(virtinst.DeviceGraphics.valid_keymaps()))
def testAlterHostdevs(self):
infile = "tests/xmlparse-xml/change-hostdevs-in.xml"
outfile = "tests/xmlparse-xml/change-hostdevs-out.xml"

View File

@ -52,8 +52,6 @@ class DeviceGraphics(Device):
CHANNEL_TYPE_RECORD = "record"
KEYMAP_LOCAL = "local"
KEYMAP_DEFAULT = "default"
_special_keymaps = [KEYMAP_LOCAL, KEYMAP_DEFAULT]
@staticmethod
def valid_keymaps():
@ -89,10 +87,7 @@ class DeviceGraphics(Device):
return self._local_keymap
def _set_keymap(self, val):
if val == self.KEYMAP_DEFAULT:
# Leave it up to the hypervisor
val = None
elif val == self.KEYMAP_LOCAL:
if val == self.KEYMAP_LOCAL:
val = self._get_local_keymap()
self._keymap = val
def _get_keymap(self):