def test_testName(self): color.blue("test here baby") filename = os.path.abspath(os.path.join(currentFolder, '../../makeTestForGo/test/createFileName1_test/deep/deep/deep/a.py')) position = 10 testFile = forPy.createFromPosition(filename, position) result = filer.read(testFile) expected = """import unittest import sys sys.path.insert(0, '/Users/maks/Library/Application Support/Sublime Text 3/Packages/util') sys.path.insert(0, '/Users/maks/Library/Application Support/Sublime Text 3/Packages/makeTest/test/createFileName1_test/deep/deep/deep') import color import assertMy import a class Test(unittest.TestCase): def test_testName(self): color.blue("test here baby") result = a.() expected = "" assertMy.equals(result, expected) if __name__ == '__main__': unittest.main()""" assertMy.equals(result, expected)
def run(self): view = self.window.active_view() filename = view.file_name() view = self.window.active_view() region1 = view.sel()[0] position = region1.a testFile = forPy.createFromPosition(filename, position) self.window.open_file(testFile)