tests: bypass cache hacking for test:///default

To allow us to test the standard code in some cases. Would have caught
the previous issue
This commit is contained in:
Cole Robinson 2017-08-30 10:36:37 -04:00
parent ec0d3072c0
commit f0e36d52e7
2 changed files with 5 additions and 2 deletions

View File

@ -36,8 +36,6 @@ os.environ["LANG"] = "en_US.UTF-8"
os.environ["HOME"] = "/tmp"
os.environ["DISPLAY"] = ":3.4"
_defaultconn = utils.open_testdefault()
# Location
image_prefix = "/tmp/__virtinst_cli_"
xmldir = "tests/cli-test-xml"

View File

@ -84,6 +84,11 @@ def openconn(uri):
virtinst.util.register_libvirt_error_handler()
conn = virtinst.cli.getConnection(uri)
# For the basic test:///default URI, skip this caching, so we have
# an option to test the stock code
if uri == uri_test_default:
return conn
if uri not in _conn_cache:
conn.fetch_all_guests()
conn.fetch_all_pools()