singer_sdk.testing.templates.AttributeTestTemplate

class singer_sdk.testing.templates.AttributeTestTemplate[source]

Base Tap Stream Attribute template.

classmethod evaluate(stream, property_name, property_schema)[source]

Determine if this attribute test is applicable to the given property.

Parameters:
  • stream (Stream) – Parent Stream of given attribute.

  • property_name (str) – Name of given attribute.

  • property_schema (dict) – JSON Schema of given property, in dict form.

Raises:

NotImplementedError – if not implemented.

Return type:

bool

run(config, resource, runner, stream, attribute_name)[source]

Test main run method.

Parameters:
  • config (SuiteConfig) – SuiteConfig instance, to use for test.

  • resource (t.Any) – A generic external resource, provided by a pytest fixture.

  • runner (TapTestRunner) – A Tap runner instance, to use with this test.

  • stream (Stream) – A Tap Stream instance, to use with this test. to use with this test.

  • attribute_name (str) – The name of the attribute to test.

Return type:

None

property id: str[source]

Test ID.

Returns:

Test ID string.

property non_null_attribute_values: list[Any][source]

Extract attribute values from stream records.

Returns:

A list of attribute values (excluding None values).