32 lines
984 B
Lua
32 lines
984 B
Lua
|
|
return function(lust)
|
||
|
|
|
||
|
|
|
||
|
|
local describe, it, expect = lust.describe, lust.it, lust.expect
|
||
|
|
|
||
|
|
describe('src/plugin/openbrush.lua', function()
|
||
|
|
|
||
|
|
describe('get API url', function() -- Can be nested
|
||
|
|
local url = app.plugin.openbrush.apiCall()
|
||
|
|
expect( url:match('https://') ).to.be.truthy()
|
||
|
|
end)
|
||
|
|
|
||
|
|
describe('parse icosa.gallery json', function() -- Can be nested
|
||
|
|
local json = util.readfile('/zip/test/json/icosagallery.json')
|
||
|
|
local opts = {body=json}
|
||
|
|
local t = app.plugin.openbrush.fetch('',opts)
|
||
|
|
expect( t.assets and #t.assets > 0 ).to.be.truthy()
|
||
|
|
end)
|
||
|
|
|
||
|
|
--describe('download icosa.gallery assets', function() -- Can be nested
|
||
|
|
-- local json = util.readfile('/zip/test/json/icosagallery.json')
|
||
|
|
-- local opts = {body=json}
|
||
|
|
-- foreach( app.plugin.openbrush.fetch(opts), function(i,t)
|
||
|
|
-- local res = app.plugin.openbrush.download(t)
|
||
|
|
-- expect( res ).to.be.truthy()
|
||
|
|
-- end)
|
||
|
|
--end)
|
||
|
|
|
||
|
|
end)
|
||
|
|
|
||
|
|
end
|