From 57b9d8bc0ed71639a666d81f916515a1439d6aeb Mon Sep 17 00:00:00 2001 From: "Eric N. Vander Weele" Date: Sat, 18 May 2019 09:42:19 -0400 Subject: [PATCH] Test for Python project root directory Add test files and a new test suite for detecting a Python project's root directory. --- test/python-test-files/python-package-project/.flake8 | 0 .../python-package-project/package-name/module.py | 0 test/test_python_find_project_root.vader | 11 +++++++++++ 3 files changed, 11 insertions(+) create mode 100644 test/python-test-files/python-package-project/.flake8 create mode 100644 test/python-test-files/python-package-project/package-name/module.py create mode 100644 test/test_python_find_project_root.vader diff --git a/test/python-test-files/python-package-project/.flake8 b/test/python-test-files/python-package-project/.flake8 new file mode 100644 index 00000000..e69de29b diff --git a/test/python-test-files/python-package-project/package-name/module.py b/test/python-test-files/python-package-project/package-name/module.py new file mode 100644 index 00000000..e69de29b diff --git a/test/test_python_find_project_root.vader b/test/test_python_find_project_root.vader new file mode 100644 index 00000000..176e819a --- /dev/null +++ b/test/test_python_find_project_root.vader @@ -0,0 +1,11 @@ +Before: + call ale#test#SetDirectory('/testplugin/test') + +After: + call ale#test#RestoreDirectory() + +Execute(Detect root of Python project with .flake8 correctly): + call ale#test#SetFilename('python-test-files/python-package-project/package-name/module.py') + AssertEqual + \ ale#path#Simplify(g:dir . '/python-test-files/python-package-project'), + \ ale#python#FindProjectRoot(bufnr(''))