feat(server-go): 分子检测扩展(qPCR Ct 判读/SERS 光谱上传/光谱库,#19)
This commit is contained in:
@@ -77,3 +77,16 @@ func TestBuildObjectKeyPrefix(t *testing.T) {
|
||||
t.Errorf("key/ext 应以 .jpg 结尾: %s / %s", key, ext)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildDataKey(t *testing.T) {
|
||||
key, ext, err := buildDataKey("spectrum", "a.CSV")
|
||||
if err != nil {
|
||||
t.Fatalf("buildDataKey 失败: %v", err)
|
||||
}
|
||||
if !strings.HasPrefix(key, "spectrum/") || !strings.HasSuffix(key, ".csv") {
|
||||
t.Errorf("key 不正确: %s", key)
|
||||
}
|
||||
if ext != ".csv" {
|
||||
t.Errorf("ext = %s, want .csv", ext)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user