forked from moon-source/moonsource-fanqie
✨ 初始提交:月读第三方书源插件集合
每个书源一个独立插件目录,含微信读书公众号订阅、书架导入等完整功能。 Co-authored-by: Copilot <[email protected]>
This commit is contained in:
commit
9190db9019
38 files changed
+5783
No files matched your search
@@ -0,0 +1,27 @@
|
||||
--[[--
|
||||
番茄 settings:登录判定必须以 sessionid 为准。
|
||||
|
||||
@module tests.moonsource_fanqie.settings_spec
|
||||
--]]
|
||||
|
||||
local Assert = require("support.assert")
|
||||
|
||||
local cfg = {}
|
||||
package.preload["utils.settings"] = function()
|
||||
return {
|
||||
getSource = function() return cfg end,
|
||||
saveSource = function(_, value) cfg = value end,
|
||||
}
|
||||
end
|
||||
|
||||
package.loaded["moonsource_fanqie.settings"] = nil
|
||||
local Settings = require("moonsource_fanqie.settings")
|
||||
|
||||
cfg = { cookies = { novel_web_id = "1", s_v_web_id = "2" } }
|
||||
Assert.is_true(not Settings:new():is_cookie_configured())
|
||||
|
||||
cfg = { cookies = { sessionid = "" } }
|
||||
Assert.is_true(not Settings:new():is_cookie_configured())
|
||||
|
||||
cfg = { cookies = { sessionid = "abc", novel_web_id = "1" } }
|
||||
Assert.is_true(Settings:new():is_cookie_configured())
|
||||
Reference in new issue
Block a user