@@ -18,16 +18,16 @@ Test Parameters
18
18
``aetest `` is a data-driven test infrastructure. Its scripts and test cases are
19
19
intended to be driven dynamically by:
20
20
21
- - Data in the form of input arguments to the test script
21
+ - Data in the form of input arguments to the TestScript
22
22
- Dynamic data generated during runtime
23
23
24
24
The collection of dynamic data that artificially affects the behavior of
25
- test scripts and test cases in ``aetest `` is called **parameters **. It adheres to
25
+ TestScripts and Testcases in ``aetest `` is called **parameters **. It adheres to
26
26
a pre-defined set of parent/child propagation relationships and may be used as
27
27
`Function Arguments `_ to each test section.
28
28
29
- This feature is a supplement to static test case data (attribute values stored
30
- within each test case ).
29
+ This feature is a supplement to static Testcase data (attribute values stored
30
+ within each Testcase ).
31
31
32
32
.. tip ::
33
33
@@ -74,7 +74,7 @@ methods as the "doer," then parameters are the "what to do with." E.g., an
74
74
add_to_c(1 , 2 )
75
75
# 103
76
76
77
- In data-driven testing, test scripts are the *doers *, performing the act
77
+ In data-driven testing, TestScripts are the *doers *, performing the act
78
78
of testing a facet of some product. Test script arguments and parameters are thus the
79
79
input data that influences the specific actions of testing. Here
80
80
are some possible use cases:
@@ -86,13 +86,13 @@ are some possible use cases:
86
86
- The ``vlan `` argument to the ``layer2_traffic `` script can dynamically control the
87
87
VLAN to be configured for traffic testing.
88
88
89
- - Other toggle arguments that dynamically turn on/off certain test cases ,
89
+ - Other toggle arguments that dynamically turn on/off certain Testcases ,
90
90
and a combination of features to be configured & tested
91
91
92
92
- Etc.
93
93
94
94
Of course, the parameters feature in ``aetest `` is much more than just script
95
- arguments. It enables users to write test cases and test scripts that are capable
95
+ arguments. It enables users to write Testcases and TestScripts that are capable
96
96
of being driven by inputs, varying the degree of testing, etc.
97
97
98
98
Relationship Model
@@ -162,7 +162,7 @@ execution, this happens behind the scenes automatically.
162
162
new_testcase_parameters.update(testcase.parameters)
163
163
testcase.parameters = new_testcase_parameters
164
164
165
- # so that the new parameters seen in the test case
165
+ # so that the new parameters seen in the Testcase
166
166
# level, is:
167
167
testcase.parameters
168
168
# {'param_A': 100, 'param_B': 2, 'param_C': 3}
@@ -178,7 +178,7 @@ Parameters Property
178
178
Every top-level object in ``aetest `` comes with the special ``parameters ``
179
179
property: a dictionary containing the key/value data pairs relative to this
180
180
object (:ref: `object_model `). Its default values can be set/updated by the user
181
- within the test script .
181
+ within the TestScript .
182
182
183
183
.. code-block :: python
184
184
@@ -203,7 +203,7 @@ within the test script.
203
203
# note that this also applies to CommonSetup & CommonCleanup
204
204
class Testcase (aetest .Testcase ):
205
205
206
- # all default parameters specific to this test case are declared
206
+ # all default parameters specific to this Testcase are declared
207
207
# in its own parameters dictionary.
208
208
parameters = {
209
209
' generic_param_A' : 200
@@ -247,7 +247,7 @@ dynamically access & update parameters.
247
247
#
248
248
# continuing from the above
249
249
250
- # re-defining the test case for the sake of code-continuity
250
+ # re-defining the Testcase for the sake of code-continuity
251
251
class Testcase (aetest .Testcase ):
252
252
253
253
# local parameters defaults, same as above
@@ -272,7 +272,7 @@ dynamically access & update parameters.
272
272
273
273
@aetest.test
274
274
def test (self ):
275
- # access & print parent test script parameters
275
+ # access & print parent TestScript parameters
276
276
# (following the parent model)
277
277
print (self .parent.parameters)
278
278
# {'generic_param_A': 100,
@@ -291,7 +291,7 @@ dynamically access & update parameters.
291
291
Consider the above example: parameters can be set and accessed as the script
292
292
runs, opening the opportunity for scripts to dynamically discover the runtime
293
293
environment and modify test behavior (parameters) as required. E.g., the ``setup ``
294
- section of modifying test case parameters based on the current testbed state, and
294
+ section of modifying Testcase parameters based on the current testbed state, and
295
295
altering the behavior of ensuing ``test `` sections, etc.
296
296
297
297
.. tip ::
@@ -306,7 +306,7 @@ altering the behavior of ensuing ``test`` sections, etc.
306
306
Script Arguments
307
307
----------------
308
308
309
- In short, any arguments passed to the test script before startup becomes part of
309
+ In short, any arguments passed to the TestScript before startup becomes part of
310
310
the ``TestScript `` parameter. This includes all the arguments passed through the
311
311
:ref: `easypy_jobfile ` during :ref: `aetest_jobfile_execution `, and/or any command
312
312
line arguments parsed and passed to ``aetest.main() `` during
@@ -323,7 +323,7 @@ line arguments parsed and passed to ``aetest.main()`` during
323
323
# without going into details about how script parameters/arguments are
324
324
# passed in (covered under Running Scripts section)
325
325
326
- # assuming that the test script was called with the following inputs
326
+ # assuming that the TestScript was called with the following inputs
327
327
script_arguments = {
328
328
' arg_a' : 100 ,
329
329
' arg_c' : 3 ,
@@ -353,7 +353,7 @@ script's base parameters and overwrite existing ones.
353
353
.. tip ::
354
354
355
355
Define your default parameters in the script, and change the behavior of
356
- the test script by overwriting specific ones using script arguments.
356
+ the TestScript by overwriting specific ones using script arguments.
357
357
358
358
.. _parameters_as_funcargs :
359
359
@@ -404,7 +404,7 @@ their support.
404
404
405
405
# this setup section definition identifies "param_B"
406
406
# as an input requirement. As this parameter is available at this
407
- # test case level (aggregated from the parent test script ), it
407
+ # Testcase level (aggregated from the parent TestScript ), it
408
408
# is passed in as input
409
409
@aetest.setup
410
410
def setup (self , param_B ):
@@ -533,7 +533,7 @@ support arguments, can identify the current execution context, and
533
533
can act accordingly.
534
534
535
535
A parametrized function is declared when the ``@parameters.parametrize ``
536
- decorator is used on a function within a test script . This also adds the newly
536
+ decorator is used on a function within a TestScript . This also adds the newly
537
537
created parametrized function automatically as part of ``TestScript ``
538
538
parameters, using the function name as the parameter name.
539
539
@@ -583,7 +583,7 @@ identical to its callable parameter sibling, with the following additions:
583
583
# As previously stated, there's no need to add parametrized functions
584
584
# to the parameters dict(). They are automatically discovered and added.
585
585
586
- # Defining two tests under this test case
586
+ # Defining two tests under this Testcase
587
587
# ----------------------------------------------
588
588
# Similar to callable parameters, the above parameters
589
589
# are evaluated when used as function arguments to section
@@ -686,8 +686,8 @@ property, and is not useable as a function argument.
686
686
# names as keyword arguments to methods
687
687
@aetest.subsection
688
688
def subsection_one (self , testscript , section , steps ):
689
- # Testscript object has an attribute called module
690
- # which is this test script 's module
689
+ # TestScript object has an attribute called module
690
+ # which is this TestScript 's module
691
691
print (testscript.module)
692
692
# <module 'example_script' from '/path/to/example.py'>
693
693
@@ -718,7 +718,7 @@ property, and is not useable as a function argument.
718
718
719
719
Reserved parameters provide ``aetest `` a mechanism to offer optional features
720
720
without polluting the :ref: `object_model ` with additional attributes. It also
721
- allows users to write test scripts that delve deeper and interact with the
721
+ allows users to write TestScripts that delve deeper and interact with the
722
722
internals of ``aetest `` using a supported method instead of hacking around.
723
723
724
724
*With great power comes great responsibilities * - use them wisely.
0 commit comments