diff options
| author | Eli Zaretskii | 2013-03-30 20:37:57 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-03-30 20:37:57 +0300 |
| commit | f1aa11971a74b7b2fa0f5baaaaf21dfbd388de6b (patch) | |
| tree | 48e20bfab4262d7171593d4ef98309ae717c1cb6 /test/automated/python-tests.el | |
| parent | 7c4026b6ad03974a55a175af17c8e76c61931b69 (diff) | |
| parent | 119b2d43cc40759394cae256c0a38624cacbf776 (diff) | |
| download | emacs-f1aa11971a74b7b2fa0f5baaaaf21dfbd388de6b.tar.gz emacs-f1aa11971a74b7b2fa0f5baaaaf21dfbd388de6b.zip | |
Merge from trunk.
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 | ||