Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hexbee
Cloudreve
提交
8d9dee6e
C
Cloudreve
项目概览
hexbee
/
Cloudreve
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cloudreve
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
8d9dee6e
编写于
2月 22, 2020
作者:
H
HFO4
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Test: migration modifications
上级
a8272a66
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
5 addition
and
30 deletion
+5
-30
models/migration.go
models/migration.go
+0
-1
models/user_test.go
models/user_test.go
+1
-1
pkg/conf/conf_test.go
pkg/conf/conf_test.go
+4
-1
pkg/conf/version_test.go
pkg/conf/version_test.go
+0
-27
未找到文件。
models/migration.go
浏览文件 @
8d9dee6e
...
...
@@ -144,7 +144,6 @@ Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; verti
{
Name
:
"defaultTheme"
,
Value
:
`#3f51b5`
,
Type
:
"basic"
},
{
Name
:
"themes"
,
Value
:
`{"#3f51b5":{"palette":{"primary":{"main":"#3f51b5"},"secondary":{"main":"#f50057"}}},"#2196f3":{"palette":{"primary":{"main":"#2196f3"},"secondary":{"main":"#FFC107"}}},"#673AB7":{"palette":{"primary":{"main":"#673AB7"},"secondary":{"main":"#2196F3"}}},"#E91E63":{"palette":{"primary":{"main":"#E91E63"},"secondary":{"main":"#42A5F5","contrastText":"#fff"}}},"#FF5722":{"palette":{"primary":{"main":"#FF5722"},"secondary":{"main":"#3F51B5"}}},"#FFC107":{"palette":{"primary":{"main":"#FFC107"},"secondary":{"main":"#26C6DA"}}},"#8BC34A":{"palette":{"primary":{"main":"#8BC34A","contrastText":"#fff"},"secondary":{"main":"#FF8A65","contrastText":"#fff"}}},"#009688":{"palette":{"primary":{"main":"#009688"},"secondary":{"main":"#4DD0E1","contrastText":"#fff"}}},"#607D8B":{"palette":{"primary":{"main":"#607D8B"},"secondary":{"main":"#F06292"}}},"#795548":{"palette":{"primary":{"main":"#795548"},"secondary":{"main":"#4CAF50","contrastText":"#fff"}}}}`
,
Type
:
"basic"
},
{
Name
:
"aria2_token"
,
Value
:
`your token`
,
Type
:
"aria2"
},
{
Name
:
"aria2_token"
,
Value
:
`your token`
,
Type
:
"aria2"
},
{
Name
:
"aria2_temp_path"
,
Value
:
``
,
Type
:
"aria2"
},
{
Name
:
"aria2_options"
,
Value
:
`[]`
,
Type
:
"aria2"
},
{
Name
:
"aria2_interval"
,
Value
:
`10`
,
Type
:
"aria2"
},
...
...
models/user_test.go
浏览文件 @
8d9dee6e
...
...
@@ -150,7 +150,7 @@ func TestNewUser(t *testing.T) {
asserts
:=
assert
.
New
(
t
)
newUser
:=
NewUser
()
asserts
.
IsType
(
User
{},
newUser
)
asserts
.
Not
Empty
(
newUser
.
Avatar
)
asserts
.
Empty
(
newUser
.
Avatar
)
}
func
TestUser_AfterFind
(
t
*
testing
.
T
)
{
...
...
pkg/conf/conf_test.go
浏览文件 @
8d9dee6e
package
conf
import
(
"github.com/HFO4/cloudreve/pkg/util"
"github.com/stretchr/testify/assert"
"io/ioutil"
"os"
...
...
@@ -12,10 +13,12 @@ func TestInitPanic(t *testing.T) {
asserts
:=
assert
.
New
(
t
)
// 日志路径不存在时
asserts
.
Panics
(
func
()
{
asserts
.
Not
Panics
(
func
()
{
Init
(
"not/exist/path"
)
})
asserts
.
True
(
util
.
Exists
(
"conf.ini"
))
}
// TestInitDelimiterNotFound 日志路径存在但 Key 格式错误时
...
...
pkg/conf/version_test.go
已删除
100644 → 0
浏览文件 @
a8272a66
package
conf
import
(
"github.com/stretchr/testify/assert"
"io/ioutil"
"os"
"testing"
)
func
TestWriteVersionLock
(
t
*
testing
.
T
)
{
asserts
:=
assert
.
New
(
t
)
// 清理残余文件
if
_
,
err
:=
os
.
Stat
(
"version.lock"
);
!
os
.
IsNotExist
(
err
)
{
err
=
os
.
Remove
(
"version.lock"
)
asserts
.
NoError
(
err
)
}
err
:=
WriteVersionLock
()
defer
func
()
{
err
=
os
.
Remove
(
"version.lock"
)
}()
writtenVersion
,
err
:=
ioutil
.
ReadFile
(
"version.lock"
)
// 写入的版本应与当前版本相同
asserts
.
NoError
(
err
)
asserts
.
Equal
(
string
(
writtenVersion
),
BackendVersion
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录