Exemplo n.º 1
0
	def req2(self):
		return _real.req1()
Exemplo n.º 2
0
def new1():
	return _real.req1()
Exemplo n.º 3
0
from zodiac import monkeypatch

monkeypatch("test_orig", "test_patch")

import test_orig as mod

assert mod.CONSTANT == 1

assert mod.req1() == "old"

assert mod.Foo().val == "new"
assert mod.Foo().req2() == "old"
assert mod.Foo().req3() == "old"

assert mod.new1() == "old"
assert mod.new2() == "new"

assert mod.Inheritor1().val == "new"
assert mod.Inheritor2().val == "new"
assert mod.Inheritor3().val == "new"

assert mod.Slots().prop.val == "new"

assert mod.user1() == "new"
assert mod.user2() == "new"

print("success!")
Exemplo n.º 4
0
def new1():
	return _real.req1()
Exemplo n.º 5
0
	def req2(self):
		return _real.req1()
Exemplo n.º 6
0
__FILENAME__ = test
from zodiac import monkeypatch
monkeypatch('test_orig', 'test_patch')

import test_orig as mod

assert mod.CONSTANT == 1

assert mod.req1() == 'old'

assert mod.Foo().val == 'new'
assert mod.Foo().req2() == 'old'
assert mod.Foo().req3() == 'old'

assert mod.new1() == 'old'
assert mod.new2() == 'new'

assert mod.Inheritor1().val == 'new'
assert mod.Inheritor2().val == 'new'
assert mod.Inheritor3().val == 'new'

assert mod.Slots().prop.val == 'new'

assert mod.user1() == 'new'
assert mod.user2() == 'new'

print('success!')

########NEW FILE########
__FILENAME__ = test_orig
import sys