diff options
Diffstat (limited to 'testing')
| -rw-r--r-- | testing/lisp/test-ob-python.el | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/lisp/test-ob-python.el b/testing/lisp/test-ob-python.el index 48ca3d64088..7e2826404f2 100644 --- a/testing/lisp/test-ob-python.el +++ b/testing/lisp/test-ob-python.el | |||
| @@ -138,6 +138,41 @@ if True: | |||
| 138 | (org-babel-execute-maybe) | 138 | (org-babel-execute-maybe) |
| 139 | (org-babel-execute-src-block))))) | 139 | (org-babel-execute-src-block))))) |
| 140 | 140 | ||
| 141 | (ert-deftest test-ob-python/if-else-block () | ||
| 142 | (should | ||
| 143 | (equal "success" (org-test-with-temp-text "#+begin_src python :session :results value | ||
| 144 | value = 'failure' | ||
| 145 | if False: | ||
| 146 | pass | ||
| 147 | else: | ||
| 148 | value = 'success' | ||
| 149 | value | ||
| 150 | #+end_src" | ||
| 151 | (org-babel-execute-src-block))))) | ||
| 152 | |||
| 153 | (ert-deftest test-ob-python/indent-block-with-blank-lines () | ||
| 154 | (should | ||
| 155 | (equal 20 | ||
| 156 | (org-test-with-temp-text "#+begin_src python :session :results value | ||
| 157 | foo = 0 | ||
| 158 | for i in range(10): | ||
| 159 | foo += 1 | ||
| 160 | |||
| 161 | foo += 1 | ||
| 162 | |||
| 163 | foo | ||
| 164 | #+end_src" | ||
| 165 | (org-babel-execute-src-block))))) | ||
| 166 | |||
| 167 | (ert-deftest test-ob-python/assign-underscore () | ||
| 168 | (should | ||
| 169 | (equal "success" | ||
| 170 | (org-test-with-temp-text "#+begin_src python :session :results value | ||
| 171 | _ = 'failure' | ||
| 172 | 'success' | ||
| 173 | #+end_src" | ||
| 174 | (org-babel-execute-src-block))))) | ||
| 175 | |||
| 141 | (provide 'test-ob-python) | 176 | (provide 'test-ob-python) |
| 142 | 177 | ||
| 143 | ;;; test-ob-python.el ends here | 178 | ;;; test-ob-python.el ends here |