# LabelSubject {.starlark-object} ## LabelSubject.equals {.starlark-signature} LabelSubject.equals([other](#labelsubject_equals_other)) Asserts the label is equal to `other`. Method: LabelSubject.equals {#labelsubject_equals_parameters} **PARAMETERS** [¶](#labelsubject_equals_parameters){.headerlink} :[other[¶](#labelsubject_equals_other){.headerlink}]{.span}: []{#labelsubject_equals_other} ([`Label`] | [`str`]) the expected value. If a `str` is passed, it will be converted to a `Label` using the `Label` function. {.starlark-object} ## LabelSubject.is_in {.starlark-signature} LabelSubject.is_in([any_of](#labelsubject_is_in_any_of)) Asserts that the label is any of the provided values. {#labelsubject_is_in_parameters} **PARAMETERS** [¶](#labelsubject_is_in_parameters){.headerlink} :[any_of[¶](#labelsubject_is_in_any_of){.headerlink}]{.span}: []{#labelsubject_is_in_any_of} ([`collection`] of ([`Label`] | [`str`])) If strings are provided, they must be parsable by `Label`. {.starlark-object} ## LabelSubject.new {.starlark-signature} LabelSubject.new([label](#labelsubject_new_label), [meta](#labelsubject_new_meta)) Creates a new `LabelSubject` for asserting `Label` objects. Method: LabelSubject.new {#labelsubject_new_parameters} **PARAMETERS** [¶](#labelsubject_new_parameters){.headerlink} {.params-box} :[label[¶](#labelsubject_new_label){.headerlink}]{.span}: []{#labelsubject_new_label} ([`Label`]) the label to check against. :[meta[¶](#labelsubject_new_meta){.headerlink}]{.span}: []{#labelsubject_new_meta} ([`ExpectMeta`]) the metadata about the call chain. {#labelsubject_new_returns} RETURNS [¶](#labelsubject_new_returns){.headerlink} : [`LabelSubject`]. [`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