diff options
author | Vincent Sanders <vince@kyllikki.org> | 2019-05-18 22:39:15 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2019-05-18 22:39:15 +0100 |
commit | 5bd54f4c0ca6d3e0c5afbaecba7ebd63e66529fd (patch) | |
tree | 3e3862bbd6522c03b5e7b3dc9608cf6fc7f23798 /test | |
parent | 2db39b1f7d813fa7a3fbe22744ff2d56463f81b7 (diff) | |
download | netsurf-5bd54f4c0ca6d3e0c5afbaecba7ebd63e66529fd.tar.gz netsurf-5bd54f4c0ca6d3e0c5afbaecba7ebd63e66529fd.tar.bz2 |
allow render checks to be empty
Diffstat (limited to 'test')
-rwxr-xr-x | test/monkey_driver.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/monkey_driver.py b/test/monkey_driver.py index c39d5e6a9..61286ff96 100755 --- a/test/monkey_driver.py +++ b/test/monkey_driver.py @@ -227,18 +227,19 @@ def run_test_step_action_plot_check(ctx, step): if plot[0] == 'BITMAP': bitmaps.append(plot[1:]) all_text = " ".join(all_text) - for check in checks: - if 'text-contains' in check.keys(): - print("Check {} in {}".format(repr(check['text-contains']),repr(all_text))) - assert(check['text-contains'] in all_text) - elif 'text-not-contains' in check.keys(): - print("Check {} NOT in {}".format(repr(check['text-not-contains']),repr(all_text))) - assert(check['text-not-contains'] not in all_text) - elif 'bitmap-count' in check.keys(): - print("Check bitmap count is {}".format(int(check['bitmap-count']))) - assert(len(bitmaps) == int(check['bitmap-count'])) - else: - raise AssertionError("Unknown check: {}".format(repr(check))) + if checks is not None: + for check in checks: + if 'text-contains' in check.keys(): + print("Check {} in {}".format(repr(check['text-contains']),repr(all_text))) + assert(check['text-contains'] in all_text) + elif 'text-not-contains' in check.keys(): + print("Check {} NOT in {}".format(repr(check['text-not-contains']),repr(all_text))) + assert(check['text-not-contains'] not in all_text) + elif 'bitmap-count' in check.keys(): + print("Check bitmap count is {}".format(int(check['bitmap-count']))) + assert(len(bitmaps) == int(check['bitmap-count'])) + else: + raise AssertionError("Unknown check: {}".format(repr(check))) def run_test_step_action_timer_start(ctx, step): print(get_indent(ctx) + "Action: " + step["action"]) |