diff options
| author | Glenn Morris | 2013-03-30 09:55:47 -0700 |
|---|---|---|
| committer | Glenn Morris | 2013-03-30 09:55:47 -0700 |
| commit | 8d3655be5a5c41b1f0a9985bcdb614693fce67e5 (patch) | |
| tree | c213796b69a9d40c6563c211c20ea815754ad560 /test/automated/python-tests.el | |
| parent | 14a581695f7b9c70b8531a41a327a2e01f6125ba (diff) | |
| parent | b011a6e8011c51e09f28d528a541509c17d4eed0 (diff) | |
| download | emacs-8d3655be5a5c41b1f0a9985bcdb614693fce67e5.tar.gz emacs-8d3655be5a5c41b1f0a9985bcdb614693fce67e5.zip | |
Merge from emacs-24; up to 2012-12-26T16:22:18Z!michael.albinus@gmx.de
Diffstat (limited to 'test/automated/python-tests.el')
| -rw-r--r-- | test/automated/python-tests.el | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index ab8eb4816d3..d0a7ab57250 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el | |||
| @@ -444,6 +444,28 @@ objects = Thing.objects.all() \\\\ | |||
| 444 | (should (eq (car (python-indent-context)) 'after-line)) | 444 | (should (eq (car (python-indent-context)) 'after-line)) |
| 445 | (should (= (python-indent-calculate-indentation) 0)))) | 445 | (should (= (python-indent-calculate-indentation) 0)))) |
| 446 | 446 | ||
| 447 | (ert-deftest python-indent-block-enders () | ||
| 448 | "Test `python-indent-block-enders' value honouring." | ||
| 449 | (python-tests-with-temp-buffer | ||
| 450 | " | ||
| 451 | Class foo(object): | ||
| 452 | |||
| 453 | def bar(self): | ||
| 454 | if self.baz: | ||
| 455 | return (1, | ||
| 456 | 2, | ||
| 457 | 3) | ||
| 458 | |||
| 459 | else: | ||
| 460 | pass | ||
| 461 | " | ||
| 462 | (python-tests-look-at "3)") | ||
| 463 | (forward-line 1) | ||
| 464 | (= (python-indent-calculate-indentation) 12) | ||
| 465 | (python-tests-look-at "pass") | ||
| 466 | (forward-line 1) | ||
| 467 | (= (python-indent-calculate-indentation) 8))) | ||
| 468 | |||
| 447 | 469 | ||
| 448 | ;;; Navigation | 470 | ;;; Navigation |
| 449 | 471 | ||
| @@ -1546,13 +1568,13 @@ class C(object): | |||
| 1546 | return [] | 1568 | return [] |
| 1547 | 1569 | ||
| 1548 | def b(): | 1570 | def b(): |
| 1549 | pass | 1571 | do_b() |
| 1550 | 1572 | ||
| 1551 | def a(): | 1573 | def a(): |
| 1552 | pass | 1574 | do_a() |
| 1553 | 1575 | ||
| 1554 | def c(self): | 1576 | def c(self): |
| 1555 | pass | 1577 | do_c() |
| 1556 | " | 1578 | " |
| 1557 | (forward-line 1) | 1579 | (forward-line 1) |
| 1558 | (should (string= "C" (python-info-current-defun))) | 1580 | (should (string= "C" (python-info-current-defun))) |
| @@ -1582,7 +1604,7 @@ class C(object): | |||
| 1582 | (python-tests-look-at "def c(self):") | 1604 | (python-tests-look-at "def c(self):") |
| 1583 | (should (string= "C.c" (python-info-current-defun))) | 1605 | (should (string= "C.c" (python-info-current-defun))) |
| 1584 | (should (string= "def C.c" (python-info-current-defun t))) | 1606 | (should (string= "def C.c" (python-info-current-defun t))) |
| 1585 | (python-tests-look-at "pass") | 1607 | (python-tests-look-at "do_c()") |
| 1586 | (should (string= "C.c" (python-info-current-defun))) | 1608 | (should (string= "C.c" (python-info-current-defun))) |
| 1587 | (should (string= "def C.c" (python-info-current-defun t))))) | 1609 | (should (string= "def C.c" (python-info-current-defun t))))) |
| 1588 | 1610 | ||