tests: Add more hostkeymap tests

This commit is contained in:
Cole Robinson 2017-10-18 18:07:04 -04:00
parent 9a9f9ecd2c
commit f0987ed9b8
5 changed files with 78 additions and 2 deletions

View File

@ -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")

View 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'

View File

@ -0,0 +1,10 @@
# KEYBOARD CONFIGURATION FILE
# Consult the keyboard(5) manual page.
XKBMODEL="pc105"
XKBLAYOUT="us"
XKBVARIANT=""
XKBOPTIONS=""
BACKSPACE="guess"

View File

@ -0,0 +1,2 @@
KEYBOARDTYPE="pc"
KEYTABLE="us"

View 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