mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
tests: Add basic hostkeymap test
To validate an upcoming bugfix
This commit is contained in:
parent
083dfcc8ec
commit
09a53eb2a3
36
tests/hostkeymap.py
Normal file
36
tests/hostkeymap.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Copyright (C) 2017 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||||
|
# MA 02110-1301 USA.
|
||||||
|
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
from virtinst import hostkeymap
|
||||||
|
|
||||||
|
|
||||||
|
class TestHostkeymap(unittest.TestCase):
|
||||||
|
"""
|
||||||
|
Tests for hostkeymap.py file parsing
|
||||||
|
"""
|
||||||
|
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")),
|
||||||
|
"de-latin1-nodeadkeys")
|
||||||
|
|
13
tests/hostkeymap/sysconfig-comments.txt
Normal file
13
tests/hostkeymap/sysconfig-comments.txt
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Path: Hardware/Keyboard
|
||||||
|
## Description: Keyboard settings
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: kbd
|
||||||
|
#
|
||||||
|
# Keyboard settings for the text console
|
||||||
|
#
|
||||||
|
# Keyboard mapping
|
||||||
|
# (/usr/share/kbd/keymaps/)
|
||||||
|
# e.g. KEYTABLE="de-latin1-nodeadkeys", "us" or empty for US settings
|
||||||
|
#
|
||||||
|
KEYTABLE=""
|
Loading…
Reference in New Issue
Block a user