From f411b8d7007ee7d0a7512207070bf42586ebc131 Mon Sep 17 00:00:00 2001 From: Richard Lobb <trampgeek@gmail.com> Date: Tue, 12 Nov 2024 16:12:01 +1300 Subject: [PATCH] Tweak indentation of PyString in behat test. --- tests/behat/test_combinator_grader.feature | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/behat/test_combinator_grader.feature b/tests/behat/test_combinator_grader.feature index 5c6245a9..c7993e60 100644 --- a/tests/behat/test_combinator_grader.feature +++ b/tests/behat/test_combinator_grader.feature @@ -29,26 +29,26 @@ Feature: test_combinator_grader And I set the field "id_useace" to "0" And I set the field "id_uiplugin" to "None" And I set the field "id_template" to: - """ - import subprocess, json, sys - {{ STUDENT_ANSWER | e('py') }} - tests = json.loads('''{{ TESTCASES | json_encode | e('py') }}''') - test_results = [['Test', 'Expected', 'Got', 'iscorrect']] - num_right = 0 - for test in tests: - code = test['testcode'] - expected = int(test['expected']) - got = eval(code) - test_results.append([code, expected, got, expected == got]) - if expected == got: - num_right += 1 - print(json.dumps({ - 'testresults': test_results, - 'fraction': num_right / len(tests), - 'prologuehtml': '<h1>I am a prologue</h1>', - 'epiloguehtml': '<h1>I am an epilogue</h1>' - })) - """ + """ + import subprocess, json, sys + {{ STUDENT_ANSWER | e('py') }} + tests = json.loads('''{{ TESTCASES | json_encode | e('py') }}''') + test_results = [['Test', 'Expected', 'Got', 'iscorrect']] + num_right = 0 + for test in tests: + code = test['testcode'] + expected = int(test['expected']) + got = eval(code) + test_results.append([code, expected, got, expected == got]) + if expected == got: + num_right += 1 + print(json.dumps({ + 'testresults': test_results, + 'fraction': num_right / len(tests), + 'prologuehtml': '<h1>I am a prologue</h1>', + 'epiloguehtml': '<h1>I am an epilogue</h1>' + })) + """ And I set the field "id_iscombinatortemplate" to "1" And I set the field "id_grader" to "TemplateGrader" And I click on "a[aria-controls='id_advancedcustomisationheadercontainer']" "css_element" @@ -69,6 +69,7 @@ Feature: test_combinator_grader | id_ordering_1 | 20 | | id_answer | def sqr(n): return n * n | + And I wait "180" seconds Then I should see "Failed testing" And I should see "Click on the << button to replace the expected output of this testcase with actual output."