diff --git a/Dockerfile b/Dockerfile index 7cf3352..e1406b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,4 +5,4 @@ LABEL Description="This image should provide environment to lint neotags" Vendor # Install dependencies RUN pip install --upgrade pip -RUN pip install --no-cache-dir pep8 neovim +RUN pip install --no-cache-dir pep8 neovim pyfakefs diff --git a/readme.rst b/readme.rst index 6068f46..995af81 100644 --- a/readme.rst +++ b/readme.rst @@ -38,3 +38,14 @@ The following options are available: - ``let g:neotags_logging = 0`` Defines whether to log anything to vims messages. + +Development +=========== + +Install dependencies: + +- ``pip install pyfakefs`` + +Run tests: + +``cd rplugin && python -m unittest test.test_neotags`` diff --git a/rplugin/test/templates/tags b/rplugin/test/templates/tags new file mode 100644 index 0000000..b2352b5 --- /dev/null +++ b/rplugin/test/templates/tags @@ -0,0 +1,9 @@ +!_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ +!_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ +!_TAG_PROGRAM_AUTHOR Universal Ctags Team // +!_TAG_PROGRAM_NAME Universal Ctags /Derived from Exuberant Ctags/ +!_TAG_PROGRAM_URL https://ctags.io/ /official site/ +!_TAG_PROGRAM_VERSION 0.0.0 /4f741b9/ +SomeClass example.py /^class SomeClass(object):$/;" kind:class line:1 language:Python inherits:object access:public end:7 +__init__ example.py /^ def __init__(self):$/;" kind:member line:3 language:Python scope:class:SomeClass access:public signature:(self) end:5 +method example.py /^ def method(self):$/;" kind:member line:6 language:Python scope:class:SomeClass access:public signature:(self) end:7 diff --git a/rplugin/test/test_neotags.py b/rplugin/test/test_neotags.py index 486aa89..25e5b26 100644 --- a/rplugin/test/test_neotags.py +++ b/rplugin/test/test_neotags.py @@ -110,6 +110,10 @@ class TestNeotagsPlugin(fake_filesystem_unittest.TestCase): 'expected_tags' ) + self.copyRealFile( + expected_tags_file, + expected_tags_file + ) self.copyRealFile( os.path.join(self.templates_dirname, 'example.py'), os.path.join(os.path.dirname(filename), os.path.basename(filename))