sync: 同步 v1.0.4 并脱敏配置与镜像

This commit is contained in:
MiFaZhan
2026-10-29 14:36:49 +08:00
parent 743e8e6e6e
commit 2206a393f7
516 changed files with 18119 additions and 2253 deletions
@@ -0,0 +1,67 @@
package model
import (
"context"
"testing"
)
func TestTSimChannelsTestParamFilterCompleteMode(t *testing.T) {
in := &TSimChannelsTestParam{
InputMode: TSimChannelsTestInputModeComplete,
Iccid: " 8986 ",
Imsi: " 4600 ",
Msisdn: " 1064 ",
}
if err := in.Filter(context.Background()); err != nil {
t.Fatalf("Filter returned error: %v", err)
}
if in.Iccid != "8986" || in.Imsi != "4600" || in.Msisdn != "1064" {
t.Fatalf("unexpected trimmed values: %#v", in)
}
}
func TestTSimChannelsTestParamFilterSingleMode(t *testing.T) {
in := &TSimChannelsTestParam{
InputMode: TSimChannelsTestInputModeSingle,
CardValueType: " IMSI ",
CardValue: " 4600 ",
}
if err := in.Filter(context.Background()); err != nil {
t.Fatalf("Filter returned error: %v", err)
}
if in.CardValueType != "imsi" || in.CardValue != "4600" {
t.Fatalf("unexpected normalized values: %#v", in)
}
}
func TestTSimChannelsTestParamFilterRejectsInvalidSingleMode(t *testing.T) {
in := &TSimChannelsTestParam{
InputMode: TSimChannelsTestInputModeSingle,
CardValueType: "imei",
CardValue: "123",
}
if err := in.Filter(context.Background()); err == nil {
t.Fatal("expected error for invalid single mode card value type")
}
}
func TestTSimChannelsTestParamFilterDirectSingleMode(t *testing.T) {
in := &TSimChannelsTestParam{
InputMode: TSimChannelsTestInputModeDirectSingle,
CardValueType: " MSISDN ",
CardValue: " 1064 ",
}
if err := in.Filter(context.Background()); err != nil {
t.Fatalf("Filter returned error: %v", err)
}
if in.CardValueType != "msisdn" || in.CardValue != "1064" {
t.Fatalf("unexpected normalized values: %#v", in)
}
}
func TestTSimChannelsTestParamFilterRejectsIncompleteDirectSingleMode(t *testing.T) {
in := &TSimChannelsTestParam{InputMode: TSimChannelsTestInputModeDirectSingle}
if err := in.Filter(context.Background()); err == nil {
t.Fatal("expected error for incomplete direct single mode")
}
}