uitests: test xmleditor textview fallback

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Cole Robinson 2024-08-06 19:51:30 -04:00
parent 8eb37c0e50
commit 95ca39aae8
2 changed files with 23 additions and 0 deletions

View File

@ -1,6 +1,8 @@
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
import unittest
import tests.utils
from . import lib
@ -799,6 +801,21 @@ def testDetailsXMLEdit(app):
lib.utils.test_xmleditor_interactions(app, win, finish)
@unittest.mock.patch.dict('os.environ',
{"VIRTINST_TEST_SUITE_FAKE_NO_SOURCEVIEW": "1"})
def testDetailsXMLEditorSourceviewFallback(app):
"""
Test XML editor standard bits, when falling back to gtk textview
"""
app.open(xmleditor_enabled=True)
win = app.manager_open_details("test-clone-simple")
finish = win.find("config-apply")
xmleditor = win.find("XML editor")
# Do standard xmleditor tests
lib.utils.test_xmleditor_interactions(app, win, finish)
def testDetailsConsoleChecksSSH(app):
"""
Trigger a bunch of console connection failures to hit

View File

@ -2,6 +2,8 @@
# See the COPYING file in the top-level directory.
# pylint: disable=wrong-import-order,ungrouped-imports
import os
import gi
from virtinst import log
@ -19,6 +21,10 @@ except ValueError: # pragma: no cover
log.debug("Not using GtkSource")
have_gtksourceview = False
if "VIRTINST_TEST_SUITE_FAKE_NO_SOURCEVIEW" in os.environ:
log.debug("Faking missing GtkSource for test suite")
have_gtksourceview = False
if have_gtksourceview:
from gi.repository import GtkSource
else: