Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@deal.chain(deal.silent, deal.offline)
def func(msg, do):
if msg:
print(msg)
if do:
http = urllib3.PoolManager()
http.request('GET', 'http://httpbin.org/robots.txt')
def test_module_load():
assert deal.activate()
try:
deal.module_load(deal.silent)
finally:
assert deactivate()
with pytest.raises(RuntimeError):
deal.module_load(deal.silent)
@deal.silent()
@deal.pure
@deal.chain(deal.safe, deal.silent)
def func(x: int) -> int:
"""docs were before docker
"""
return x
@deal.silent
@deal.silent()
@deal.pure
@deal.chain(deal.safe, deal.silent)
def func(x: int) -> int:
"""docs were before docker
"""
return x
@deal.chain(deal.safe, deal.silent)
def func(x: int) -> int:
"""docs were before docker
"""
return x
('deal.silent', deal.silent),
('deal.silent()', deal.silent),
('deal.pre(something)', None),
('not_a_deal.silent', None),
('deal.typo', None),
])
def test_exec_contract(text, expected):
tree = ast.parse(text)
print(ast.dump(tree))
actual = DealLoader._exec_contract(node=tree.body[0].value)
assert actual == expected
@deal.silent
async def func(msg):
if msg:
print(msg)
return msg
@deal.silent
def func(msg):
if msg:
print(msg)
@deal.silent
def func(msg):
if msg:
print(msg)
yield msg
@deal.chain(deal.silent, deal.offline)
def func(msg, do):
if msg:
print(msg)
if do:
http = urllib3.PoolManager()
http.request('GET', 'http://httpbin.org/robots.txt')