|
19 | 19 | def python_add(a, b): |
20 | 20 | return a + b |
21 | 21 |
|
22 | | -window.python_add = python_add |
| 22 | +window.py_add = python_add |
23 | 23 |
|
24 | 24 | print("After python_add to JS") |
25 | 25 | </script> |
26 | 26 |
|
27 | 27 | <script> |
28 | | -const add = (a, b) => a + b; |
| 28 | +const js_add = (a, b) => a + b; |
29 | 29 | QUnit.module('js_add_test', function() { |
30 | 30 | QUnit.test('should add two numbers', function(assert) { |
31 | | - assert.equal(add(1, 1), 2, '1 + 1 = 2'); |
| 31 | + assert.equal(js_add(1, 1), 2, '1 + 1 = 2'); |
32 | 32 | }); |
33 | 33 | }); |
34 | 34 |
|
35 | 35 | QUnit.module('py_add_test', function() { |
36 | 36 | QUnit.test('should add two numbers in Brython', function(assert) { |
37 | | - assert.equal(add(2, 3), 5, '2 + 3 = 5 (python)'); |
| 37 | + assert.equal(py_add(2, 3), 5, '2 + 3 = 5 (python)'); |
38 | 38 | }); |
39 | 39 | }); |
40 | 40 |
|
41 | 41 | QUnit.module('py_add_failed_test', function() { |
42 | 42 | QUnit.test('should add two numbers in Brython (failure)', function(assert) { |
43 | | - assert.equal(add(2, 3), 6, '2 + 3 != 6 (python)'); |
| 43 | + assert.equal(py_add(2, 3), 6, '2 + 3 != 6 (python)'); |
44 | 44 | }); |
45 | 45 | }); |
46 | 46 |
|
|
0 commit comments