New user here. Just wrote my first plugin (fun API!); but I’m having an issue writing tests for the plugin. It could be a simple Python issue, too (I’m relatively new to Python, as well). This is the error:
ImportError: No module named sublime
Here’s the distilled unit test, which resides in my-plugin/tests:
import unittest
import json
from my_plugin import MyCommand
class MyUnitTest(unittest.TestCase):
def test_read_json_data(self):
...
Very abbreviated plugin:
import sublime_plugin
import sublime
class MyCommand(sublime_plugin.TextCommand):
def run(edit):
...
It fails on the ‘import sublime’ statement above when I try to instantiate ‘MyCommand’. In other words, the test code doesn’t execute beyond the import statements.
So, where is the sublime module such that I can add it to my path? Or maybe there’s a different (better?) approach to writing tests?
Any help is much appreciated!
-bill