RunfilesSubject¶
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 ¶
RunfilesSubject
object.
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_predicate¶
RunfilesSubject.contains_predicate(matcher)
Asserts that matcher
matches at least one value.
Method: RunfilesSubject.contains_predicate
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_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_str
and 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.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).
RunfilesSubject.check_workspace_prefix¶
RunfilesSubject.check_workspace_prefix(path)
PARAMETERS ¶
- path¶:
undocumented