From 698d929522dce955dee37da9d24b03320e8bc59b Mon Sep 17 00:00:00 2001 From: aarnphm-ec2-dev <29749331+aarnphm@users.noreply.github.com> Date: Wed, 28 Jun 2023 04:25:09 +0000 Subject: [PATCH] tests: add dict protocol cases Signed-off-by: aarnphm-ec2-dev <29749331+aarnphm@users.noreply.github.com> --- .github/workflows/auto-bot.yml | 8 -------- tests/test_configuration.py | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/auto-bot.yml b/.github/workflows/auto-bot.yml index 4695a22d..1d39660d 100644 --- a/.github/workflows/auto-bot.yml +++ b/.github/workflows/auto-bot.yml @@ -30,11 +30,3 @@ jobs: run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - pre-commit: - runs-on: ubuntu-latest - if: ${{ github.actor == 'pre-commit-ci[bot]' }} - steps: - - name: Enable auto-merge for Dependabot PRs - run: gh pr merge --auto --squash ${{ github.event.pull_request.html_url }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 491c5350..a0302371 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -224,3 +224,12 @@ def test_click_conversion(gen_settings: ModelSettings): filtered = {k for k, v in cl_.__openllm_hints__.items() if t.get_origin(v) is not t.Union} click_options_filtered = [i for i in wrapped.__click_params__ if i.name and not i.name.startswith("fake_")] assert len(filtered) == len(click_options_filtered) + + +@pytest.mark.parametrize("model_name", openllm.CONFIG_MAPPING.keys()) +def test_configuration_dict_protocol(model_name: str): + config = openllm.AutoConfig.for_model(model_name) + assert isinstance(config.items(), list) + assert isinstance(config.keys(), list) + assert isinstance(config.values(), list) + assert isinstance(dict(config), dict)