Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_load():
cmd = mc.Load('main.any', defs = {'TEST_STR': '"Test\\string"'} )
assert cmd.get_macro(0) == 'load "main.any" -def TEST_STR=---"\\"Test\\\\string\\""'
cmd = mc.Load('main.any', defs = {'TEST_VAR': 'Main.MyStudy'} )
assert cmd.get_macro(0) == 'load "main.any" -def TEST_VAR="Main.MyStudy"'
cmd = mc.Load('main.any', paths = {'TEST_PATH': 'c:\\path\\to\\something' })
assert cmd.get_macro(0) == 'load "main.any" -p TEST_PATH=---"c:\\\\path\\\\to\\\\something"'
def test_macros():
mcr = AnyMacro(number_of_macros = 10)
mcr.append(mc.Load('main.any'))
macros = mcr.create_macros()
assert macros[0][0] == 'load "main.any"'
assert macros[1][0] == 'load "main.any"'
assert len(macros) == 10
def test_load():
cmd = mc.Load('main.any', defs = {'TEST_STR': '"Test\\string"'} )
assert cmd.get_macro(0) == 'load "main.any" -def TEST_STR=---"\\"Test\\\\string\\""'
cmd = mc.Load('main.any', defs = {'TEST_VAR': 'Main.MyStudy'} )
assert cmd.get_macro(0) == 'load "main.any" -def TEST_VAR="Main.MyStudy"'
cmd = mc.Load('main.any', paths = {'TEST_PATH': 'c:\\path\\to\\something' })
assert cmd.get_macro(0) == 'load "main.any" -p TEST_PATH=---"c:\\\\path\\\\to\\\\something"'
from anypytools import AnyPyProcess
from anypytools.macro_commands import Load, OperationRun
app = AnyPyProcess(num_processes = 3)
macro = [Load("main.any"),
OperationRun('Main.Study.InverseDynamics') ]
app.start_macro(macro, search_subdirs= "model[1-9].*main.any" )