diff --git a/spec/scraper_spec.lua b/spec/scraper_spec.lua index 7ea38bb..40b427b 100644 --- a/spec/scraper_spec.lua +++ b/spec/scraper_spec.lua @@ -167,6 +167,18 @@ describe('cp.scrape', function() end) it('handles python environment setup failure', 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 false + end + vim.system = function(cmd) if cmd[1] == 'ping' then return { @@ -174,12 +186,6 @@ describe('cp.scrape', function() return { code = 0 } end, } - elseif cmd[1] == 'uv' and cmd[2] == 'sync' then - return { - wait = function() - return { code = 1, stderr = 'setup failed' } - end, - } end return { wait = function() @@ -188,10 +194,6 @@ describe('cp.scrape', function() } end - vim.fn.isdirectory = function() - return 0 - end - local result = scrape.scrape_contest_metadata('atcoder', 'abc123') assert.is_false(result.success)