mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
808 B
40 lines
808 B
package conf_test |
|
|
|
import ( |
|
"testing" |
|
|
|
"v2ray.com/core/common/protocol" |
|
"v2ray.com/core/common/serial" |
|
. "v2ray.com/core/infra/conf" |
|
"v2ray.com/core/proxy/mtproto" |
|
) |
|
|
|
func TestMTProtoServerConfig(t *testing.T) { |
|
creator := func() Buildable { |
|
return new(MTProtoServerConfig) |
|
} |
|
|
|
runMultiTestCase(t, []TestCase{ |
|
{ |
|
Input: `{ |
|
"users": [{ |
|
"email": "love@v2ray.com", |
|
"level": 1, |
|
"secret": "b0cbcef5a486d9636472ac27f8e11a9d" |
|
}] |
|
}`, |
|
Parser: loadJSON(creator), |
|
Output: &mtproto.ServerConfig{ |
|
User: []*protocol.User{ |
|
{ |
|
Email: "love@v2ray.com", |
|
Level: 1, |
|
Account: serial.ToTypedMessage(&mtproto.Account{ |
|
Secret: []byte{176, 203, 206, 245, 164, 134, 217, 99, 100, 114, 172, 39, 248, 225, 26, 157}, |
|
}), |
|
}, |
|
}, |
|
}, |
|
}, |
|
}) |
|
}
|
|
|