I would like to be able to define data structures more directly. Is it possible to define dictionary literals / json literals that occupy more than a single line as in the following example?
my_dict = { 'prop1': 'val', 'prop2': { 'innerprop1': 123, 'innerprop2': [1,2,3,4,5] }, 'prop3': ['a','b','c'] }
What about multiline function definitions?
def my_func(arg1, arg2): something = do_something(arg1) something_else = do_something_else(arg2)<br> return arg1 + arg2
Not sure why there is a 5. in the output, its not there in my post. Please ignore the 5. in the my_dict example.
Answer by alexorr · Apr 19, 2021 at 06:12 PM
Is this in reference to iTest? If so, you can do multi-line steps by going to step properties and clicking the Details button on the Command field. For a function definition, however, I'd recommend creating a new procedure either in your test case or in a separate procedure library.
I do not see a "Details" button anywhere within the Step Properties pane. Can you tell me where to find it?
Answer by alexorr · Apr 29, 2021 at 06:14 PM
Make sure you have the step you want to change highlighted.
Passing JSON from itest into python command 6 Answers
Python API for Spirent Test center 2 Answers
Landslide python runningTest sample script automation 3 Answers
Just curious, Does Spirent use the DPDK Framework for testing ? 0 Answers
Is there a license or option required to open python sessions? 2 Answers
Copyright 2008- Spirent Communications, all rights reserved. Terms and Conditions.