Improve testing of %pythonprepend and %pythonappend
This commit is contained in:
parent
ace8fcd972
commit
1c44078751
2 changed files with 24 additions and 2 deletions
|
|
@ -4,19 +4,34 @@ Testcase to test %pythonprepend and %pythonappend
|
|||
|
||||
%module python_append
|
||||
|
||||
%pythoncode %{
|
||||
import os.path
|
||||
mypath = os.path.dirname("/a/b/c/d.txt")
|
||||
funcpath = None
|
||||
staticfuncpath = None
|
||||
def grabpath():
|
||||
return funcpath
|
||||
def grabstaticpath():
|
||||
return staticfuncpath
|
||||
%}
|
||||
|
||||
%pythonappend Test::func %{
|
||||
pass
|
||||
funcpath = os.path.dirname(funcpath)
|
||||
%}
|
||||
|
||||
%pythonprepend Test::func %{
|
||||
pass
|
||||
global funcpath
|
||||
funcpath = mypath
|
||||
%}
|
||||
|
||||
%pythonappend Test::static_func %{
|
||||
staticfuncpath = os.path.basename(staticfuncpath)
|
||||
pass
|
||||
%}
|
||||
|
||||
%pythonprepend Test::static_func {
|
||||
global staticfuncpath
|
||||
staticfuncpath = mypath
|
||||
pass
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue