[PR #9146] [MERGED] test: add test cases for ListHandler defined in cmd/cmd.go #11614

Closed
opened 2025-11-12 16:18:13 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9146
Author: @yuiseki
Created: 2/16/2025
Status: Merged
Merged: 2/19/2025
Merged by: @BruceMacD

Base: mainHead: test-cmd-list


📝 Commits (1)

  • dbb474e test: add test cases for ListHandler defined in cmd/cmd.go

📊 Changes

1 file changed (+91 additions, -0 deletions)

View changed files

📝 cmd/cmd_test.go (+91 -0)

📄 Description

This pull request adds a new, missing test cases and updates the import statements in the cmd/cmd_test.go file.

The most important changes include the addition of the TestListHandler function and the inclusion of the time package in the imports.

New Test Function:

  • cmd/cmd_test.go: Added TestListHandler function to test the ListHandler with several scenarios, including listing all models, filtering models by prefix, and handling server errors.

Import Updates:


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/9146 **Author:** [@yuiseki](https://github.com/yuiseki) **Created:** 2/16/2025 **Status:** ✅ Merged **Merged:** 2/19/2025 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `test-cmd-list` --- ### 📝 Commits (1) - [`dbb474e`](https://github.com/ollama/ollama/commit/dbb474e43f89df299eaaea958528016ee632ced9) test: add test cases for ListHandler defined in cmd/cmd.go ### 📊 Changes **1 file changed** (+91 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd_test.go` (+91 -0) </details> ### 📄 Description This pull request adds a new, missing test cases and updates the import statements in the `cmd/cmd_test.go` file. The most important changes include the addition of the `TestListHandler` function and the inclusion of the `time` package in the imports. ### New Test Function: * [`cmd/cmd_test.go`](diffhunk://#diff-35b67677fb9bfd928efa0b86411cd4886c8e95752055258f7f12e88262e4da1fR494-R583): Added `TestListHandler` function to test the `ListHandler` with several scenarios, including listing all models, filtering models by prefix, and handling server errors. ### Import Updates: * [`cmd/cmd_test.go`](diffhunk://#diff-35b67677fb9bfd928efa0b86411cd4886c8e95752055258f7f12e88262e4da1fR13): Added the `time` package to the import statements. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-12 16:18:13 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama-ollama#11614