# DepsetFileSubject {.starlark-object} ## DepsetFileSubject.contains {.starlark-signature} DepsetFileSubject.contains([expected](#depsetfilesubject_contains_expected)) Asserts that the depset of files contains the provided path/file. Method: DepsetFileSubject.contains {#depsetfilesubject_contains_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_parameters){.headerlink} :[expected[¶](#depsetfilesubject_contains_expected){.headerlink}]{.span}: []{#depsetfilesubject_contains_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. {.starlark-object} ## DepsetFileSubject.contains_any_in {.starlark-signature} DepsetFileSubject.contains_any_in([expected](#depsetfilesubject_contains_any_in_expected)) Asserts that any of the values in `expected` exist. Method: DepsetFileSubject.contains_any_in {#depsetfilesubject_contains_any_in_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_any_in_parameters){.headerlink} :[expected[¶](#depsetfilesubject_contains_any_in_expected){.headerlink}]{.span}: []{#depsetfilesubject_contains_any_in_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`. {.starlark-object} ## DepsetFileSubject.contains_at_least {.starlark-signature} DepsetFileSubject.contains_at_least([expected](#depsetfilesubject_contains_at_least_expected)) Asserts that the depset of files contains at least the provided paths. Method: DepsetFileSubject.contains_at_least {#depsetfilesubject_contains_at_least_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_at_least_parameters){.headerlink} :[expected[¶](#depsetfilesubject_contains_at_least_expected){.headerlink}]{.span}: []{#depsetfilesubject_contains_at_least_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. {#depsetfilesubject_contains_at_least_returns} RETURNS [¶](#depsetfilesubject_contains_at_least_returns){.headerlink} : [`Ordered`] (see `_ordered_incorrectly_new`). {.starlark-object} ## DepsetFileSubject.contains_at_least_predicates {.starlark-signature} DepsetFileSubject.contains_at_least_predicates([matchers](#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()`. {#depsetfilesubject_contains_at_least_predicates_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_at_least_predicates_parameters){.headerlink} :[matchers[¶](#depsetfilesubject_contains_at_least_predicates_matchers){.headerlink}]{.span}: []{#depsetfilesubject_contains_at_least_predicates_matchers} ([`list`] of [`Matcher`]) (see `matchers` struct) that accept [`File`] objects. {#depsetfilesubject_contains_at_least_predicates_returns} RETURNS [¶](#depsetfilesubject_contains_at_least_predicates_returns){.headerlink} : [`Ordered`] (see `_ordered_incorrectly_new`). {.starlark-object} ## DepsetFileSubject.contains_exactly {.starlark-signature} DepsetFileSubject.contains_exactly([paths](#depsetfilesubject_contains_exactly_paths)) Asserts the depset of files contains exactly the given paths. Method: DepsetFileSubject.contains_exactly {#depsetfilesubject_contains_exactly_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_exactly_parameters){.headerlink} :[paths[¶](#depsetfilesubject_contains_exactly_paths){.headerlink}]{.span}: []{#depsetfilesubject_contains_exactly_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. {.starlark-object} ## DepsetFileSubject.contains_none_of {.starlark-signature} DepsetFileSubject.contains_none_of([values](#depsetfilesubject_contains_none_of_values)) Asserts that the depset of files contains none of the provided paths. Method: DepsetFileSubject.contains_none_of {#depsetfilesubject_contains_none_of_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_none_of_parameters){.headerlink} :[values[¶](#depsetfilesubject_contains_none_of_values){.headerlink}]{.span}: []{#depsetfilesubject_contains_none_of_values} (['collection'] of ['str'] | collection of ['File']. If string paths are provided then 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. {.starlark-object} ## DepsetFileSubject.contains_predicate {.starlark-signature} DepsetFileSubject.contains_predicate([matcher](#depsetfilesubject_contains_predicate_matcher)) Asserts that `matcher` matches at least one value. Method: DepsetFileSubject.contains_predicate {#depsetfilesubject_contains_predicate_parameters} **PARAMETERS** [¶](#depsetfilesubject_contains_predicate_parameters){.headerlink} :[matcher[¶](#depsetfilesubject_contains_predicate_matcher){.headerlink}]{.span}: []{#depsetfilesubject_contains_predicate_matcher} [`Matcher`] (see `matching` struct) that accepts `File` objects. {.starlark-object} ## DepsetFileSubject.new {.starlark-signature} DepsetFileSubject.new([files](#depsetfilesubject_new_files), [meta](#depsetfilesubject_new_meta), [container_name](#depsetfilesubject_new_container_name)="depset", [element_plural_name](#depsetfilesubject_new_element_plural_name)="files") Creates a DepsetFileSubject asserting on `files`. Method: DepsetFileSubject.new {#depsetfilesubject_new_parameters} **PARAMETERS** [¶](#depsetfilesubject_new_parameters){.headerlink} {.params-box} :[files[¶](#depsetfilesubject_new_files){.headerlink}]{.span}: []{#depsetfilesubject_new_files} ([`depset`] of [`File`]) the values to assert on. :[meta[¶](#depsetfilesubject_new_meta){.headerlink}]{.span}: []{#depsetfilesubject_new_meta} ([`ExpectMeta`]) of call chain information. :[container_name[¶](#depsetfilesubject_new_container_name){.headerlink}]{.span}: []{#depsetfilesubject_new_container_name} (_default `"depset"`_) ([`str`]) conceptual name of the container. :[element_plural_name[¶](#depsetfilesubject_new_element_plural_name){.headerlink}]{.span}: []{#depsetfilesubject_new_element_plural_name} (_default `"files"`_) ([`str`]) the plural word for the values in the container. {#depsetfilesubject_new_returns} RETURNS [¶](#depsetfilesubject_new_returns){.headerlink} : [`DepsetFileSubject`] object. {.starlark-object} ## DepsetFileSubject.not_contains {.starlark-signature} DepsetFileSubject.not_contains([short_path](#depsetfilesubject_not_contains_short_path)) Asserts that `short_path` is not in the depset. Method: DepsetFileSubject.not_contains_predicate {#depsetfilesubject_not_contains_parameters} **PARAMETERS** [¶](#depsetfilesubject_not_contains_parameters){.headerlink} :[short_path[¶](#depsetfilesubject_not_contains_short_path){.headerlink}]{.span}: []{#depsetfilesubject_not_contains_short_path} ([`str`]) the short path that should not be present. {.starlark-object} ## DepsetFileSubject.not_contains_predicate {.starlark-signature} DepsetFileSubject.not_contains_predicate([matcher](#depsetfilesubject_not_contains_predicate_matcher)) Asserts that nothing in the depset matches `matcher`. Method: DepsetFileSubject.not_contains_predicate {#depsetfilesubject_not_contains_predicate_parameters} **PARAMETERS** [¶](#depsetfilesubject_not_contains_predicate_parameters){.headerlink} :[matcher[¶](#depsetfilesubject_not_contains_predicate_matcher){.headerlink}]{.span}: []{#depsetfilesubject_not_contains_predicate_matcher} ([`Matcher`]) that must match. It operates on [`File`] objects. [`Action`]: https://bazel.build/rules/lib/Action [`ActionSubject`]: /api/action_subject [`bool`]: https://bazel.build/rules/lib/bool [`BoolSubject`]: /api/bool_subject [`CollectionSubject`]: /api/collection_subject [`depset`]: https://bazel.build/rules/lib/depset [`DepsetFileSubject`]: /api/depset_file_subject [`dict`]: https://bazel.build/rules/lib/dict [`DictSubject`]: /api/dict_subject [`Expect`]: /api/expect [`ExpectMeta`]: /api/expect_meta [`File`]: https://bazel.build/rules/lib/File [`FileSubject`]: /api/file_subject [`format_str`]: /api/expect_meta.html#expectmeta-format-str [`IntSubject`]: /api/int_subject [`Label`]: https://bazel.build/rules/lib/Label [`LabelSubject`]: /api/label_subject [`list`]: https://bazel.build/rules/lib/list [`Ordered`]: /api/ordered [`RunfilesSubject`]: /api/runfiles_subject [`str`]: https://bazel.build/rules/lib/string [`struct`]: https://bazel.build/rules/lib/builtins/struct [`StrSubject`]: /api/str_subject [`StructSubject`]: /api/struct_subject [`Target`]: https://bazel.build/rules/lib/Target [`TargetSubject`]: /api/target_subject [target-name]: https://bazel.build/concepts/labels#target-names [attr-label]: https://bazel.build/concepts/labels