[PR #725] [MERGED] Less boilerplate in models/ unit tests #15543

Closed
opened 2025-11-02 11:49:01 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/725
Author: @ethantkoenig
Created: 1/22/2017
Status: Merged
Merged: 1/25/2017
Merged by: @lunny

Base: masterHead: refactor/test


📝 Commits (1)

  • 93c4b7f Less boilerplate in models/ unit tests

📊 Changes

6 files changed (+47 additions, -113 deletions)

View changed files

📝 models/access_test.go (+14 -17)
📝 models/action_test.go (+16 -32)
📝 models/pull_test.go (+10 -32)
📝 models/setup_for_test.go (+2 -1)
📝 models/token_test.go (+3 -19)
📝 models/update_test.go (+2 -12)

📄 Description

Change signature of AssertExistsAndLoadBean so that test fixtures can be loaded in a single line of code. Also add calls to AssertExistsAndLoadBean and AssertNotExistsBean to eliminate duplicated logic.


🔄 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/go-gitea/gitea/pull/725 **Author:** [@ethantkoenig](https://github.com/ethantkoenig) **Created:** 1/22/2017 **Status:** ✅ Merged **Merged:** 1/25/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `refactor/test` --- ### 📝 Commits (1) - [`93c4b7f`](https://github.com/go-gitea/gitea/commit/93c4b7fcc78ea2ad2a49f2e1a0f5aaad6346ae39) Less boilerplate in models/ unit tests ### 📊 Changes **6 files changed** (+47 additions, -113 deletions) <details> <summary>View changed files</summary> 📝 `models/access_test.go` (+14 -17) 📝 `models/action_test.go` (+16 -32) 📝 `models/pull_test.go` (+10 -32) 📝 `models/setup_for_test.go` (+2 -1) 📝 `models/token_test.go` (+3 -19) 📝 `models/update_test.go` (+2 -12) </details> ### 📄 Description Change signature of `AssertExistsAndLoadBean` so that test fixtures can be loaded in a single line of code. Also add calls to `AssertExistsAndLoadBean` and `AssertNotExistsBean` to eliminate duplicated logic. --- <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-02 11:49:01 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#15543