Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit e10a4ce

Browse files
committed
Handle submodules on modname
1 parent 8d321f0 commit e10a4ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/gentest

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,11 @@ def main(args):
6565
gopath = _get_gopath()
6666
workdir = 'build' # It is ok _right now_
6767
py_dir = os.path.join(workdir, 'src', '__python__')
68-
mod_dir = os.path.join(py_dir, modname)
68+
mod_dir = os.path.join(py_dir, modname.replace('.', '/'))
6969

70-
script = os.path.join(py_dir, '%s.py' % modname)
70+
script = os.path.join(py_dir, '%s.py' % modname.replace('.', '/'))
7171
gopath = gopath + os.pathsep + workdir
72+
testfile_modname = modname[:-5] if modname.endswith('_test') else modname
7273

7374
if not os.path.isfile(script):
7475
return # The script does not exist. And is OK!
@@ -89,7 +90,6 @@ def main(args):
8990

9091
imports = '\n\t'.join('_ "%s"' % _package_name(name) for name in names)
9192

92-
testfile_modname = modname[:-5] if modname.endswith('_test') else modname
9393
testfile_contents = template % (testfile_modname, imports)
9494
with open(os.path.join(mod_dir, 'module_test.go'), 'w') as go_testfile:
9595
go_testfile.write(testfile_contents)

0 commit comments

Comments
 (0)