SquishTests: Don't use lists of dicts

...when that doesn't have any advantages.

Change-Id: I0c58e30ae0b9e278e3336646332279f6243719d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2023-07-26 18:26:26 +02:00
parent b57f72e3c8
commit b95aba56b5
2 changed files with 18 additions and 20 deletions

View File

@@ -359,24 +359,22 @@ def __lowerStrs__(iterable):
def __checkCreatedSettings__(settingsFolder):
waitForCleanShutdown()
qtProj = os.path.join(settingsFolder, "QtProject")
folders = []
files = [{os.path.join(qtProj, "QtCreator.db"):0},
{os.path.join(qtProj, "QtCreator.ini"):30}]
folders.append(os.path.join(qtProj, "qtcreator"))
files.extend([{os.path.join(folders[0], "debuggers.xml"):0},
{os.path.join(folders[0], "devices.xml"):0},
{os.path.join(folders[0], "helpcollection.qhc"):0},
{os.path.join(folders[0], "profiles.xml"):0},
{os.path.join(folders[0], "qtversion.xml"):0},
{os.path.join(folders[0], "toolchains.xml"):0}])
folders.extend([os.path.join(folders[0], "generic-highlighter"),
os.path.join(folders[0], "macros")])
creatorFolder = os.path.join(qtProj, "qtcreator")
folders = [creatorFolder,
os.path.join(creatorFolder, "generic-highlighter"),
os.path.join(creatorFolder, "macros")]
files = {os.path.join(qtProj, "QtCreator.db"):0,
os.path.join(qtProj, "QtCreator.ini"):30,
os.path.join(creatorFolder, "debuggers.xml"):0,
os.path.join(creatorFolder, "devices.xml"):0,
os.path.join(creatorFolder, "helpcollection.qhc"):0,
os.path.join(creatorFolder, "profiles.xml"):0,
os.path.join(creatorFolder, "qtversion.xml"):0,
os.path.join(creatorFolder, "toolchains.xml"):0}
for f in folders:
test.verify(os.path.isdir(f),
"Verifying whether folder '%s' has been created." % os.path.basename(f))
for f in files:
fName = next(iter(f.keys()))
fMinSize = next(iter(f.values()))
for fName, fMinSize in files.items():
text = "created non-empty"
if fMinSize > 0:
text = "modified"

View File

@@ -86,12 +86,12 @@ def __clickCommit__(count):
show = str(description.plainText)
id = "Nobody <nobody@nowhere\.com>"
time = "\w{3} \w{3} \d{1,2} \d{2}:\d{2}:\d{2} \d{4}.* seconds ago\)"
expected = [{"commit %s" % commit:False},
{"Author: %s, %s" % (id, time): True},
{"Committer: %s, %s" % (id, time): True}]
expected = [["commit %s" % commit, False],
["Author: %s, %s" % (id, time), True],
["Committer: %s, %s" % (id, time), True]]
for line, exp in zip(show.splitlines(), expected):
expLine = next(iter(exp.keys()))
isRegex = next(iter(exp.values()))
expLine = exp[0]
isRegex = exp[1]
if isRegex:
test.verify(re.match(expLine, line), "Verifying commit header line '%s'" % line)
else: