RunfilesSubject¶
RunfilesSubject.check_workspace_prefix¶
RunfilesSubject.check_workspace_prefix(path)
PARAMETERS ¶
- path¶:
undocumented
RunfilesSubject.contains¶
RunfilesSubject.contains(expected)
Assert that the runfiles contains the provided path.
Method: RunfilesSubject.contains
PARAMETERS ¶
RunfilesSubject.contains_at_least¶
RunfilesSubject.contains_at_least(paths)
Assert that the runfiles contains at least all of the provided paths.
Method: RunfilesSubject.contains_at_least
All the paths must exist, but extra paths are allowed. Order is not checked. Multiplicity is respected.
PARAMETERS ¶
RunfilesSubject.contains_at_least_predicates¶
RunfilesSubject.contains_at_least_predicates(matchers)
Assert that the runfiles contains at least all of the provided matchers.
The runfile paths must match all the matchers. 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 ¶
RunfilesSubject.contains_exactly¶
RunfilesSubject.contains_exactly(paths)
Asserts that the runfiles contains_exactly the set of paths
Method: RunfilesSubject.contains_exactly
PARAMETERS ¶
RunfilesSubject.contains_exactly_predicates¶
RunfilesSubject.contains_exactly_predicates(expected)
Asserts the runfiles contains exactly the given matchers.
See CollectionSubject.contains_exactly_predicates for details on
behavior.
PARAMETERS ¶
RunfilesSubject.contains_none_of¶
RunfilesSubject.contains_none_of(paths, require_workspace_prefix=True)
Asserts the runfiles contain none of paths.
Method: RunfilesSubject.contains_none_of
PARAMETERS ¶
- paths¶:
([
collection] ofstr) the paths that should not exist. They should be runfiles root-relative paths (not workspace relative). The value is formatted usingExpectMeta.format_strand the current contextual keywords.- require_workspace_prefix¶:
(default
True) (bool) True to check that the path includes the workspace prefix. This is to guard against accidentallly passing a workspace relative path, which will (almost) never exist, and cause the test to always pass. Specify False if the file being checked for is actually a runfiles-root relative path that isn’t under the workspace itself.
RunfilesSubject.contains_predicate¶
RunfilesSubject.contains_predicate(matcher)
Asserts that matcher matches at least one value.
Method: RunfilesSubject.contains_predicate
PARAMETERS ¶
RunfilesSubject.new¶
RunfilesSubject.new(runfiles, meta, kind=None)
Creates a “RunfilesSubject” struct.
Method: RunfilesSubject.new
PARAMETERS ¶
- runfiles¶:
([
runfiles]) the runfiles to check against.- meta¶:
(
ExpectMeta) the metadata about the call chain.- kind¶:
(default
None) (optionalstr) what type of runfiles they are, usually “data” or “default”. If not known or not applicable, use None.
- RETURNS ¶
RunfilesSubjectobject.
RunfilesSubject.not_contains¶
RunfilesSubject.not_contains(path, require_workspace_prefix=True)
Assert that the runfiles does not contain the given path.
Method: RunfilesSubject.not_contains
PARAMETERS ¶
- path¶:
(
str) the path that should not exist. It should be a runfiles root-relative path (not workspace relative). The value is formatted usingformat_str, so its template keywords can be directly passed.- require_workspace_prefix¶:
(default
True) (bool) True to check that the path includes the workspace prefix. This is to guard against accidentallly passing a workspace relative path, which will (almost) never exist, and cause the test to always pass. Specify False if the file being checked for is actually a runfiles-root relative path that isn’t under the workspace itself.
RunfilesSubject.not_contains_predicate¶
RunfilesSubject.not_contains_predicate(matcher)
Asserts that none of the runfiles match matcher.
Method: RunfilesSubject.not_contains_predicate
PARAMETERS ¶
- matcher¶:
[
Matcher] that accepts a string (runfiles root-relative path).