arjuna.tpi.data.record module

class arjuna.tpi.data.record.DataRecord(*vargs, context=None, process=True, **kwargs)

Bases: object

Represents a single Data Record

When you use drive_with argument in @test decorator to associate a Data Source, the test function is repeated as many times as there are data records. For each such iteration, a DataRecord object is passed to the data argument of test function.

Note

For retrieving indexed objects you have to use [] notation (just like a list or tuple), for example

record[1]

For retrieving named objects, you can either use . notation or [] notation (just like a dict), for example

record.obj_name
record[obj_name]
has_index(index)

Check if DataRecord has an index for which an object is present.

Returns

True/False

has_key(key)

Check if DataRecord has a key/name for which an object is present.

Returns

True/False

property indexed_values

Get all indexed/positional objects

property indexed_values_as_json

Get the indexed values in this Data Record as a JsonList.

is_empty() → bool

Check if DataRecord has not indexed or named objects.

Returns

True/False

property named_values

Get all named objects

property named_values_as_json

Get the named values in this Data Record as a JsonDict.