tests: add dict protocol cases

Signed-off-by: aarnphm-ec2-dev <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
aarnphm-ec2-dev
2023-06-28 04:25:09 +00:00
parent c0a9aa4314
commit 698d929522
2 changed files with 9 additions and 8 deletions

View File

@@ -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 }}

View File

@@ -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)