~python-mode-devs/python-mode/python-mode

« back to all changes in this revision

Viewing changes to test/py-shell-arg-ert-tests.el

  • Committer: Barry Warsaw
  • Date: 2017-02-24 21:38:07 UTC
  • Revision ID: barry@python.org-20170224213807-h762012vx6fgvrve
Move repo to GitLab

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
;;; py-shell-arg-ert-tests.el --- py-shell ert tests
2
 
 
3
 
;; Copyright (C) 2015  Andreas Röhler
4
 
;; Author: Andreas Röhler <andreas.roehler@online.de>
5
 
;; Keywords: languages, convenience
6
 
 
7
 
;; This program is free software; you can redistribute it and/or modify
8
 
;; it under the terms of the GNU General Public License as published by
9
 
;; the Free Software Foundation, either version 3 of the License, or
10
 
;; (at your option) any later version.
11
 
 
12
 
;; This program is distributed in the hope that it will be useful,
13
 
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
;; GNU General Public License for more details.
16
 
 
17
 
;; You should have received a copy of the GNU General Public License
18
 
;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
 
20
 
;;; Commentary:
21
 
 
22
 
;; This file is generated by function from python-mode-utils.el - see in
23
 
;; directory devel. Edits here might not be persistent.
24
 
 
25
 
;;; Code:
26
 
 
27
 
(ert-deftest py-ert-python-shell-test ()
28
 
  (let ((py-python-command-args  (list "-i -c\"abc=4\"")))
29
 
    (py-kill-buffer-unconditional "*Python*")
30
 
    (python)
31
 
    (should (buffer-live-p (get-buffer "*Python*")))
32
 
    (set-buffer (get-buffer "*Python*"))
33
 
    (should (string= "4" py-result))
34
 
    (should (< 1 comint-last-input-end))))
35
 
 
36
 
(ert-deftest py-ert-python2-shell-test ()
37
 
  (let ((py-python2-command-args  (list "-i -c\"abc=4\"")))
38
 
    (py-kill-buffer-unconditional "*Python2*")
39
 
    (python2)
40
 
    (should (buffer-live-p (get-buffer "*Python2*")))
41
 
    (set-buffer (get-buffer "*Python2*"))
42
 
    (should (string= "4" py-result))
43
 
    (should (< 1 comint-last-input-end))))
44
 
 
45
 
(ert-deftest py-ert-python3-shell-test ()
46
 
  (let ((py-python3-command-args  (list "-i -c\"abc=4\"")))
47
 
    (py-kill-buffer-unconditional "*Python3*")
48
 
    (python3)
49
 
    (should (buffer-live-p (get-buffer "*Python3*")))
50
 
    (set-buffer (get-buffer "*Python3*"))
51
 
    (should (string= "4" py-result))
52
 
    (should (< 1 comint-last-input-end))))
53
 
 
54
 
(ert-deftest py-ert-ipython-shell-test ()
55
 
  (let ((py-ipython-command-args  (list "-i -c\"abc=4\"")))
56
 
    (py-kill-buffer-unconditional "*IPython*")
57
 
    (ipython)
58
 
    (should (buffer-live-p (get-buffer "*IPython*")))
59
 
    (set-buffer (get-buffer "*IPython*"))
60
 
    (should (string= "4" py-result))
61
 
    (should (< 1 comint-last-input-end))))
62
 
 
63
 
(ert-deftest py-ert-ipython2.7-shell-test ()
64
 
  (let ((py-ipython2.7-command-args  (list "-i -c\"abc=4\"")))
65
 
    (py-kill-buffer-unconditional "*IPython2.7*")
66
 
    (ipython2.7)
67
 
    (should (buffer-live-p (get-buffer "*IPython2.7*")))
68
 
    (set-buffer (get-buffer "*IPython2.7*"))
69
 
    (should (string= "4" py-result))
70
 
    (should (< 1 comint-last-input-end))))
71
 
 
72
 
(ert-deftest py-ert-ipython3-shell-test ()
73
 
  (let ((py-ipython3-command-args  (list "-i -c\"abc=4\"")))
74
 
    (py-kill-buffer-unconditional "*IPython3*")
75
 
    (ipython3)
76
 
    (should (buffer-live-p (get-buffer "*IPython3*")))
77
 
    (set-buffer (get-buffer "*IPython3*"))
78
 
    (should (string= "4" py-result))
79
 
    (should (< 1 comint-last-input-end))))
80
 
 
81
 
(ert-deftest py-ert-jython-shell-test ()
82
 
  (let ((py-jython-command-args  (list "-i -c\"abc=4\"")))
83
 
    (py-kill-buffer-unconditional "*Jython*")
84
 
    (jython)
85
 
    (should (buffer-live-p (get-buffer "*Jython*")))
86
 
    (set-buffer (get-buffer "*Jython*"))
87
 
    (should (string= "4" py-result))
88
 
    (should (< 1 comint-last-input-end))))
89
 
 
90
 
(provide 'py-shell-arg-ert-tests)
91
 
;;; py-shell-arg-ert-tests.el ends here
92