CIME.XML.test_reporter.TestReporter

class CIME.XML.test_reporter.TestReporter[source]

Bases: GenericXML

Methods

__init__

initialize an object

add_child

Add element node to self at root

add_result

attrib

change_file

check_timestamp

Returns True if timestamp matches what is expected

copy

get

get_child

get_children

This is the critical function, its interface and performance are crucial.

get_element_text

get_id

get_optional_child

get_raw_record

get_resolved_value

A value in the xml file may contain references to other xml variables or to environment variables.

get_value

get_value is expected to be defined by the derived classes, if you get here the value was not found in the class.

get_values

get_version

has

invalidate

lock

A subclass is doing caching, we need to lock the tree structure in order to avoid invalidating cache.

make_child

make_child_comment

name

pop

push2testdb

read

Read and parse an xml file into the object.

read_fd

remove_child

scan_child

Get an xml element matching nodename with optional attributes.

scan_children

scan_optional_child

Get an xml element matching nodename with optional attributes.

set

set_element_text

set_name

set_text

set_value

ignore_type is not used in this flavor

setup_header

text

to_string

unlock

validate_timestamp

validate_xml_file

validate an XML file against a provided schema file using pylint

write

Write an xml file from data in self

class CacheEntry(tree, root, modtime)[source]

Bases: tuple

count(value, /)[source]

Return number of occurrences of value.

index(value, start=0, stop=9223372036854775807, /)[source]

Return first index of value.

Raises ValueError if the value is not present.

modtime[source]

Alias for field number 2

root[source]

Alias for field number 1

tree[source]

Alias for field number 0

add_child(node, root=None, position=None)[source]

Add element node to self at root

check_timestamp()[source]

Returns True if timestamp matches what is expected

get_children(name=None, attributes=None, root=None)[source]

This is the critical function, its interface and performance are crucial.

You can specify attributes={key:None} if you want to select children with the key attribute but you don’t care what its value is.

get_resolved_value(raw_value, allow_unresolved_envvars=False, subgroup=None)[source]

A value in the xml file may contain references to other xml variables or to environment variables. These are refered to in the perl style with $name and $ENV{name}.

>>> obj = GenericXML()
>>> os.environ["FOO"] = "BAR"
>>> os.environ["BAZ"] = "BARF"
>>> obj.get_resolved_value("one $ENV{FOO} two $ENV{BAZ} three")
'one BAR two BARF three'
>>> obj.get_resolved_value("2 + 3 - 1")
'4'
>>> obj.get_resolved_value("0001-01-01")
'0001-01-01'
>>> obj.get_resolved_value("$SHELL{echo hi}") == 'hi'
True
get_value(item, attribute=None, resolved=True, subgroup=None)[source]

get_value is expected to be defined by the derived classes, if you get here the value was not found in the class.

lock()[source]

A subclass is doing caching, we need to lock the tree structure in order to avoid invalidating cache.

read(infile, schema=None)[source]

Read and parse an xml file into the object. The schema variable can either be a path to an xsd schema file or a dictionary of paths to files by version.

scan_child(nodename, attributes=None, root=None)[source]

Get an xml element matching nodename with optional attributes.

Error unless exactly one match.

scan_optional_child(nodename, attributes=None, root=None)[source]

Get an xml element matching nodename with optional attributes.

Return None if no match.

set_value(vid, value, subgroup=None, ignore_type=True)[source]

ignore_type is not used in this flavor

validate_xml_file(filename, schema)[source]

validate an XML file against a provided schema file using pylint

write(outfile=None, force_write=False)[source]

Write an xml file from data in self