test(sdk/watcher): add tests for excluded models merging and priority parsing logic

- Added unit tests for combining OAuth excluded models across global and attribute-specific scopes.
- Implemented priority attribute parsing with support for different formats and trimming.
This commit is contained in:
Luis Pater
2026-02-11 20:35:13 +08:00
parent dc279de443
commit 4c133d3ea9
4 changed files with 211 additions and 2 deletions

View File

@@ -118,8 +118,9 @@ func (s *FileSynthesizer) Synthesize(ctx *SynthesisContext) ([]*coreauth.Auth, e
case float64:
a.Attributes["priority"] = strconv.Itoa(int(v))
case string:
if _, err := strconv.Atoi(v); err == nil {
a.Attributes["priority"] = v
priority := strings.TrimSpace(v)
if _, errAtoi := strconv.Atoi(priority); errAtoi == nil {
a.Attributes["priority"] = priority
}
}
}