fix: better tests
This commit is contained in:
parent
30c1c0f2cf
commit
a2b3de51d7
3 changed files with 39 additions and 2 deletions
|
|
@ -183,12 +183,31 @@ describe('cp.picker', function()
|
|||
|
||||
it('returns empty list when scraping fails', function()
|
||||
local cache = require('cp.cache')
|
||||
local utils = require('cp.utils')
|
||||
|
||||
cache.load = function() end
|
||||
cache.get_contest_data = function(_, _)
|
||||
return nil
|
||||
end
|
||||
|
||||
utils.setup_python_env = function()
|
||||
return true
|
||||
end
|
||||
utils.get_plugin_path = function()
|
||||
return '/tmp'
|
||||
end
|
||||
|
||||
vim.system = function()
|
||||
return {
|
||||
wait = function()
|
||||
return {
|
||||
code = 1,
|
||||
stderr = 'Scraping failed',
|
||||
}
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
picker = spec_helper.fresh_require('cp.pickers', { 'cp.pickers.init' })
|
||||
|
||||
local problems = picker.get_problems_for_contest('test_platform', 'test_contest')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue