Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_networkml(args, expected_code=0):
sys.argv = ['bin/networkml'] + args
if expected_code:
with pytest.raises(SystemExit) as pytest_wrapped_e:
netml = NetworkML()
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.value.code == expected_code
return netml
else:
return NetworkML()
def run_networkml(args, expected_code=0):
sys.argv = ['bin/networkml'] + args
if expected_code:
with pytest.raises(SystemExit) as pytest_wrapped_e:
netml = NetworkML()
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.value.code == expected_code
return netml
else:
return NetworkML()