mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-08 04:58:29 +03:00
tests: Add more hostkeymap tests
This commit is contained in:
parent
9a9f9ecd2c
commit
f0987ed9b8
@ -25,12 +25,30 @@ class TestHostkeymap(unittest.TestCase):
|
||||
"""
|
||||
Tests for hostkeymap.py file parsing
|
||||
"""
|
||||
# pylint: disable=protected-access
|
||||
|
||||
def testFiles(self):
|
||||
def _open(filename):
|
||||
return file(os.path.join(os.getcwd(),
|
||||
"tests/hostkeymap", filename))
|
||||
|
||||
self.assertEquals(
|
||||
hostkeymap._sysconfig_keyboard(_open("sysconfig-comments.txt")),
|
||||
hostkeymap._sysconfig_keyboard(
|
||||
_open("sysconfig-comments.txt")),
|
||||
"")
|
||||
|
||||
self.assertEquals(
|
||||
hostkeymap._sysconfig_keyboard(
|
||||
_open("sysconfig-rhel5.txt")),
|
||||
"us")
|
||||
self.assertEquals(
|
||||
hostkeymap._find_xkblayout(
|
||||
_open("default-keyboard-debian9.txt")),
|
||||
"us")
|
||||
self.assertEquals(
|
||||
hostkeymap._find_xkblayout(
|
||||
_open("console-setup-debian9.txt")),
|
||||
None)
|
||||
self.assertEquals(
|
||||
hostkeymap._xorg_keymap(
|
||||
_open("xorg-rhel5.txt")),
|
||||
"us")
|
||||
|
16
tests/hostkeymap/console-setup-debian9.txt
Normal file
16
tests/hostkeymap/console-setup-debian9.txt
Normal file
@ -0,0 +1,16 @@
|
||||
# CONFIGURATION FILE FOR SETUPCON
|
||||
|
||||
# Consult the console-setup(5) manual page.
|
||||
|
||||
ACTIVE_CONSOLES="/dev/tty[1-6]"
|
||||
|
||||
CHARMAP="UTF-8"
|
||||
|
||||
CODESET="Lat15"
|
||||
FONTFACE="Fixed"
|
||||
FONTSIZE="8x16"
|
||||
|
||||
VIDEOMODE=
|
||||
|
||||
# The following is an example how to use a braille font
|
||||
# FONT='lat9w-08.psf.gz brl-8x8.psf'
|
10
tests/hostkeymap/default-keyboard-debian9.txt
Normal file
10
tests/hostkeymap/default-keyboard-debian9.txt
Normal file
@ -0,0 +1,10 @@
|
||||
# KEYBOARD CONFIGURATION FILE
|
||||
|
||||
# Consult the keyboard(5) manual page.
|
||||
|
||||
XKBMODEL="pc105"
|
||||
XKBLAYOUT="us"
|
||||
XKBVARIANT=""
|
||||
XKBOPTIONS=""
|
||||
|
||||
BACKSPACE="guess"
|
2
tests/hostkeymap/sysconfig-rhel5.txt
Normal file
2
tests/hostkeymap/sysconfig-rhel5.txt
Normal file
@ -0,0 +1,2 @@
|
||||
KEYBOARDTYPE="pc"
|
||||
KEYTABLE="us"
|
30
tests/hostkeymap/xorg-rhel5.txt
Normal file
30
tests/hostkeymap/xorg-rhel5.txt
Normal file
@ -0,0 +1,30 @@
|
||||
# Xorg configuration created by pyxf86config
|
||||
|
||||
Section "ServerLayout"
|
||||
Identifier "Default Layout"
|
||||
Screen 0 "Screen0" 0 0
|
||||
InputDevice "Keyboard0" "CoreKeyboard"
|
||||
EndSection
|
||||
|
||||
Section "InputDevice"
|
||||
Identifier "Keyboard0"
|
||||
Driver "kbd"
|
||||
Option "XkbModel" "pc105"
|
||||
Option "XkbLayout" "us"
|
||||
EndSection
|
||||
|
||||
Section "Device"
|
||||
Identifier "Videocard0"
|
||||
Driver "vesa"
|
||||
EndSection
|
||||
|
||||
Section "Screen"
|
||||
Identifier "Screen0"
|
||||
Device "Videocard0"
|
||||
DefaultDepth 24
|
||||
SubSection "Display"
|
||||
Viewport 0 0
|
||||
Depth 24
|
||||
EndSubSection
|
||||
EndSection
|
||||
|
Loading…
x
Reference in New Issue
Block a user