DepsetFileSubject

DepsetFileSubject.new

DepsetFileSubject.new(files, meta, container_name=”depset”, element_plural_name=”files”)

Creates a DepsetFileSubject asserting on files.

Method: DepsetFileSubject.new

PARAMETERS

files:

(depset of File) the values to assert on.

meta:

(ExpectMeta) of call chain information.

container_name:

(default "depset") (str) conceptual name of the container.

element_plural_name:

(default "files") (str) the plural word for the values in the container.

RETURNS

DepsetFileSubject object.

DepsetFileSubject.contains

DepsetFileSubject.contains(expected)

Asserts that the depset of files contains the provided path/file.

Method: DepsetFileSubject.contains

PARAMETERS

expected:

(str | File) If a string path is provided, it is compared to the short path of the files and are formatted using [ExpectMeta.format_str] and its current contextual keywords. Note that, when using File objects, two files’ configurations must be the same for them to be considered equal.

DepsetFileSubject.contains_at_least

DepsetFileSubject.contains_at_least(expected)

Asserts that the depset of files contains at least the provided paths.

Method: DepsetFileSubject.contains_at_least

PARAMETERS

expected:

([collection] of str | collection of File) multiplicity is respected. If string paths are provided, they are compared to the short path of the files and are formatted using ExpectMeta.format_str and its current contextual keywords. Note that, when using File objects, two files’ configurations must be the same for them to be considered equal.

RETURNS

Ordered (see _ordered_incorrectly_new).

DepsetFileSubject.contains_any_in

DepsetFileSubject.contains_any_in(expected)

Asserts that any of the values in expected exist.

Method: DepsetFileSubject.contains_any_in

PARAMETERS

expected:

([collection] of str paths | [collection] of File) at least one of the values must exist. Note that, when using File objects, two files’ configurations must be the same for them to be considered equal. When string paths are provided, they are compared to File.short_path.

DepsetFileSubject.contains_at_least_predicates

DepsetFileSubject.contains_at_least_predicates(matchers)

Assert that the depset is a subset of the given predicates.

Method: DepsetFileSubject.contains_at_least_predicates

The depset must match all the predicates. It can contain extra elements. The multiplicity of matchers is respected. Checking that the relative order of matches is the same as the passed-in matchers order can done by calling in_order().

PARAMETERS

matchers:

(list of [Matcher]) (see matchers struct) that accept File objects.

RETURNS

Ordered (see _ordered_incorrectly_new).

DepsetFileSubject.contains_predicate

DepsetFileSubject.contains_predicate(matcher)

Asserts that matcher matches at least one value.

Method: DepsetFileSubject.contains_predicate

PARAMETERS

matcher:

[Matcher] (see matching struct) that accepts File objects.

DepsetFileSubject.contains_exactly

DepsetFileSubject.contains_exactly(paths)

Asserts the depset of files contains exactly the given paths.

Method: DepsetFileSubject.contains_exactly

PARAMETERS

paths:

([collection] of str) the paths that must exist. These are compared to the short_path values of the files in the depset. All the paths, and no more, must exist.

DepsetFileSubject.not_contains

DepsetFileSubject.not_contains(short_path)

Asserts that short_path is not in the depset.

Method: DepsetFileSubject.not_contains_predicate

PARAMETERS

short_path:

(str) the short path that should not be present.

DepsetFileSubject.not_contains_predicate

DepsetFileSubject.not_contains_predicate(matcher)

Asserts that nothing in the depset matches matcher.

Method: DepsetFileSubject.not_contains_predicate

PARAMETERS

matcher:

([Matcher]) that must match. It operates on File objects.