def METHOD_NAME() -> None:
    class AuthorityMatcher(URLDownloadHandler):
        match_authority = "pantsbuild.com"
    class SchemeMatcher(URLDownloadHandler):
        match_scheme = "http"
    union_membership = UnionMembership({URLDownloadHandler: [AuthorityMatcher, SchemeMatcher]})
    with pytest.raises(Exception, match=r"Too many registered URL handlers"):
        run_rule_with_mocks(
            download_file,
            rule_args=[
                DownloadFile("http://pantsbuild.com/file.txt", DOWNLOADS_FILE_DIGEST),
                union_membership,
            ],
            mock_gets=[
                MockGet(
                    output_type=Digest,
                    input_types=(URLDownloadHandler,),
                    mock=lambda _: None,
                ),
                MockGet(
                    output_type=Digest,
                    input_types=(NativeDownloadFile,),
                    mock=lambda _: DOWNLOADS_EXPECTED_DIRECTORY_DIGEST,
                ),
            ],
            union_membership=union_membership,
        )