Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
with self.assertRaises(AttributeError):
script.function('_badname')
script.function('function')
script.function('test')
# Test getting variable value
self.assertEqual(script.test, value,
msg="Variable value {0} doesn't match expected {1}!".format(
script.test, value))
# Test setting variable value
value = 10
script.test = 10
self.assertEqual(script.test, value,
msg="Variable value {0} doesn't match expected {1}!".format(
script.test, value))
# Test outside modification
ahk.execute("test := test+5\n")
self.assertEqual(script.test, value+5,
msg="Variable value {0} doesn't match expected {1}!".format(
script.test, value+5))
def store(cmd):
"""execute replacement for mock."""
# Object in outer scope used in closure to store a value
inner_delay.append(int(ahk.get("A_ControlDelay")))
if 'send' not in cmd.lower():
#print cmd, inner_delay
ahk.execute(cmd)