3 # Nose-compatible test name preparer
4 # Maintainer: Sergey Matveev <stargrave@stargrave.org>
5 # License: GNU General Public License version 3 of the License or later
7 # When standing inside TestCase's test method, type <leader>t and full
8 # Python (your.project.tests:TestCaseName.test_method_name) path will be
9 # copied to clipboard ("*) register.
13 var postfix = matchstr(getline(search(".*\s*def .*[Tt]est", "b")), '\w\+(')[: -2]
14 postfix = matchstr(getline(search("^\s*class", "bn")), '\w\+(')[: -2] .. "." .. postfix
16 var base = join([""] + split(getcwd(), "/")[: -1], "/")
17 var prefix = substitute(expand("%:p:r")[len(base) + 1 :], "/", ".", "g")
18 var name = prefix .. ":" .. postfix