# Copyright 2024 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
"""Test API for bazel_roll."""

from PB.recipe_modules.pigweed.bazel_roll.git_repository import GitRepository
from recipe_engine import recipe_test_api


class BazelRollTestApi(recipe_test_api.RecipeTestApi):
    """Test API for bazel_roll."""

    def _url(self, x: str = 'pigweed/pigweed'):
        assert ':' not in x
        return f'https://pigweed.googlesource.com/{x}'

    def git_repo(
        self,
        *,
        workspace_path='',
        name=None,
        remote=None,
        branch='main',
    ):
        return GitRepository(
            workspace_path=workspace_path,
            name=name,
            remote=remote or self._url('pigweed/pigweed'),
            branch=branch,
        )
