aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-11-08 17:43:06 +0100
committerGitHub <noreply@github.com>2023-11-08 17:43:06 +0100
commit3e2432ad0bca01fc3356389b341aa3e5e2da9fd8 (patch)
treecfc2c6e41b8244de4531dfbcf548c73bce503889 /tests
parentchore(main): release 1.8.2 (#1543) (diff)
downloadmason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.tar
mason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.tar.gz
mason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.tar.bz2
mason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.tar.lz
mason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.tar.xz
mason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.tar.zst
mason-3e2432ad0bca01fc3356389b341aa3e5e2da9fd8.zip
fix(pypi): support MSYS2 virtual environments on Windows (#1547)
Diffstat (limited to 'tests')
-rw-r--r--tests/mason-core/installer/managers/pypi_spec.lua13
-rw-r--r--tests/mason-core/installer/registry/link_spec.lua2
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/mason-core/installer/managers/pypi_spec.lua b/tests/mason-core/installer/managers/pypi_spec.lua
index cb4bc2b3..353606aa 100644
--- a/tests/mason-core/installer/managers/pypi_spec.lua
+++ b/tests/mason-core/installer/managers/pypi_spec.lua
@@ -1,4 +1,5 @@
local installer = require "mason-core.installer"
+local match = require "luassert.match"
local path = require "mason-core.path"
local pypi = require "mason-core.installer.managers.pypi"
local spy = require "luassert.spy"
@@ -35,6 +36,9 @@ describe("pypi manager", function()
it("should init venv and upgrade pip", function()
local ctx = create_dummy_context()
stub(ctx, "promote_cwd")
+ stub(ctx.fs, "file_exists")
+ ctx.fs.file_exists.on_call_with(match.ref(ctx.fs), "venv/bin/python").returns(true)
+
installer.exec_in_context(ctx, function()
pypi.init { upgrade_pip = true, install_extra_args = { "--proxy", "http://localhost" } }
end)
@@ -60,6 +64,8 @@ describe("pypi manager", function()
it("should install", function()
local ctx = create_dummy_context()
+ stub(ctx.fs, "file_exists")
+ ctx.fs.file_exists.on_call_with(match.ref(ctx.fs), "venv/bin/python").returns(true)
installer.exec_in_context(ctx, function()
pypi.install("pypi-package", "1.0.0")
end)
@@ -81,6 +87,8 @@ describe("pypi manager", function()
it("should write output", function()
local ctx = create_dummy_context()
+ stub(ctx.fs, "file_exists")
+ ctx.fs.file_exists.on_call_with(match.ref(ctx.fs), "venv/bin/python").returns(true)
spy.on(ctx.stdio_sink, "stdout")
installer.exec_in_context(ctx, function()
@@ -92,6 +100,9 @@ describe("pypi manager", function()
it("should install extra specifier", function()
local ctx = create_dummy_context()
+ stub(ctx.fs, "file_exists")
+ ctx.fs.file_exists.on_call_with(match.ref(ctx.fs), "venv/bin/python").returns(true)
+
installer.exec_in_context(ctx, function()
pypi.install("pypi-package", "1.0.0", {
extra = "lsp",
@@ -115,6 +126,8 @@ describe("pypi manager", function()
it("should install extra packages", function()
local ctx = create_dummy_context()
+ stub(ctx.fs, "file_exists")
+ ctx.fs.file_exists.on_call_with(match.ref(ctx.fs), "venv/bin/python").returns(true)
installer.exec_in_context(ctx, function()
pypi.install("pypi-package", "1.0.0", {
extra_packages = { "extra-package" },
diff --git a/tests/mason-core/installer/registry/link_spec.lua b/tests/mason-core/installer/registry/link_spec.lua
index 662e1323..eb6af1cc 100644
--- a/tests/mason-core/installer/registry/link_spec.lua
+++ b/tests/mason-core/installer/registry/link_spec.lua
@@ -119,7 +119,7 @@ describe("registry linker", function()
["npm:executable"] = "node_modules/.bin/executable",
["nuget:executable"] = "executable",
["opam:executable"] = "bin/executable",
- ["pypi:executable"] = "venv/bin/executable",
+ -- ["pypi:executable"] = "venv/bin/executable",
}
for bin, path in pairs(matrix) do