-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make `fing-file-in-project' an optional dependency (#1681)
- Loading branch information
Showing
8 changed files
with
154 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,127 @@ | ||
(ert-deftest elpy-find--test-file-should-return-nil-if-not-found () | ||
(elpy-testcase ((:project project-root "foo.py")) | ||
(find-file (f-join project-root "foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (equal (elpy-find--test-file) | ||
nil))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (equal (elpy-find--test-file) | ||
nil)))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-test-file-same-directory () | ||
(elpy-testcase ((:project project-root "foo.py" "test_foo.py")) | ||
(find-file (f-join project-root "foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "test_foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "test_foo.py"))))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-test-file-in-test-directory () | ||
(elpy-testcase ((:project project-root "foo.py" "test/test_foo.py")) | ||
(find-file (f-join project-root "foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "test/test_foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "test/test_foo.py"))))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-test-file-in-tests-directory () | ||
(elpy-testcase ((:project project-root "foo.py" "tests/test_foo.py")) | ||
(find-file (f-join project-root "foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "tests/test_foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "tests/test_foo.py"))))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-test-file-in-test-superdirectory () | ||
(elpy-testcase ((:project project-root "pkg/foo.py" "test/test_foo.py")) | ||
(find-file (f-join project-root "pkg/foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "test/test_foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "test/test_foo.py"))))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-test-file-in-tests-superdirectory () | ||
(elpy-testcase ((:project project-root "pkg/foo.py" "tests/test_foo.py")) | ||
(find-file (f-join project-root "pkg/foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "tests/test_foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "tests/test_foo.py"))))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-implementation-file-same-directory () | ||
(elpy-testcase ((:project project-root "foo.py" "test_foo.py")) | ||
(find-file (f-join project-root "test_foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "foo.py"))))) | ||
|
||
(ert-deftest elpy-find--test-file-should-find-implementation-file-superdirectory () | ||
(elpy-testcase ((:project project-root "foo.py" "tests/test_foo.py")) | ||
(find-file (f-join project-root "tests/test_foo.py")) | ||
(elpy-set-project-root project-root) | ||
|
||
(defun projectile-find-file ()) | ||
(when (require 'projectile nil t) | ||
(fmakunbound 'find-file-in-project) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "foo.py")))) | ||
(defun find-file-in-project ()) | ||
(require 'find-file-in-project) | ||
(fmakunbound 'projectile-find-file) | ||
(should (f-equal? (elpy-find--test-file) | ||
(f-join project-root "foo.py"))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters