Clean and update documentation
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
37
model/docs_test.go
Normal file
37
model/docs_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDocumentedConsumerModelTypes(t *testing.T) {
|
||||
raw, err := os.ReadFile("../docs/consumers/pkg-model.md")
|
||||
if err != nil {
|
||||
t.Fatalf("ReadFile(pkg-model.md) error = %v", err)
|
||||
}
|
||||
doc := string(raw)
|
||||
|
||||
required := []string{
|
||||
"gitea.maximumdirect.net/ejr/weatherfeeder/model",
|
||||
"WeatherObservation",
|
||||
"WeatherForecastRun",
|
||||
"WeatherForecastPeriod",
|
||||
"WeatherForecastDiscussion",
|
||||
"WeatherForecastDiscussionSection",
|
||||
"WeatherStoryRun",
|
||||
"WeatherStory",
|
||||
"WeatherAlertRun",
|
||||
"WeatherAlert",
|
||||
"WeatherAlertReference",
|
||||
"WeatherOutlookRun",
|
||||
"WeatherOutlook",
|
||||
"WMOCode",
|
||||
}
|
||||
for _, want := range required {
|
||||
if !strings.Contains(doc, want) {
|
||||
t.Fatalf("docs/consumers/pkg-model.md missing %q", want)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user