mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
feat(policy): add Google Drive Oauth client
This commit is contained in:
@@ -25,7 +25,7 @@ func TestGetPolicyByID(t *testing.T) {
|
||||
asserts.NoError(err)
|
||||
asserts.NoError(mock.ExpectationsWereMet())
|
||||
asserts.Equal("默认存储策略", policy.Name)
|
||||
asserts.Equal("123", policy.OptionsSerialized.OdRedirect)
|
||||
asserts.Equal("123", policy.OptionsSerialized.OauthRedirect)
|
||||
|
||||
rows = sqlmock.NewRows([]string{"name", "type", "options"})
|
||||
mock.ExpectQuery("^SELECT(.+)").WillReturnRows(rows)
|
||||
@@ -39,7 +39,7 @@ func TestGetPolicyByID(t *testing.T) {
|
||||
policy, err := GetPolicyByID(uint(22))
|
||||
asserts.NoError(err)
|
||||
asserts.Equal("默认存储策略", policy.Name)
|
||||
asserts.Equal("123", policy.OptionsSerialized.OdRedirect)
|
||||
asserts.Equal("123", policy.OptionsSerialized.OauthRedirect)
|
||||
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestPolicy_BeforeSave(t *testing.T) {
|
||||
|
||||
testPolicy := Policy{
|
||||
OptionsSerialized: PolicyOption{
|
||||
OdRedirect: "123",
|
||||
OauthRedirect: "123",
|
||||
},
|
||||
}
|
||||
expected, _ := json.Marshal(testPolicy.OptionsSerialized)
|
||||
|
||||
Reference in New Issue
Block a user