This commit is contained in:
Luigi311
2024-01-05 22:44:56 -07:00
parent 98a824bfdc
commit 1edfecae42
2 changed files with 17 additions and 10 deletions

View File

@@ -20,24 +20,32 @@ def check_marklog(lines, expected_values):
if line not in expected_values:
raise Exception("Line not found in marklog: " + line)
found_values.append(line)
# Check to make sure the marklog contains the same number of values as the expected values
if len(found_values) != len(expected_values):
raise Exception("Marklog did not contain the same number of values as the expected values, found " +
str(len(found_values)) + " values, expected " + str(len(expected_values)) + " values")
raise Exception(
"Marklog did not contain the same number of values as the expected values, found "
+ str(len(found_values))
+ " values, expected "
+ str(len(expected_values))
+ " values"
)
# Check that the two lists contain the same values
if sorted(found_values) != sorted(expected_values):
raise Exception("Marklog did not contain the same values as the expected values, found:\n" +
"\n".join(sorted(found_values)) + "\n\nExpected:\n" + "\n".join(sorted(expected_values)))
raise Exception(
"Marklog did not contain the same values as the expected values, found:\n"
+ "\n".join(sorted(found_values))
+ "\n\nExpected:\n"
+ "\n".join(sorted(expected_values))
)
return True
except Exception as e:
print(e)
return False
def main():
expected_values = [
@@ -61,6 +69,5 @@ def main():
exit(0)
if __name__ == "__main__":
main()