poetry: add module
This commit is contained in:
parent
2846d5230a
commit
670d9ecc3e
7 changed files with 113 additions and 0 deletions
27
tests/modules/programs/poetry/custom-settings.nix
Normal file
27
tests/modules/programs/poetry/custom-settings.nix
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.poetry = {
|
||||
enable = true;
|
||||
settings = {
|
||||
virtualenvs.create = true;
|
||||
virtualenvs.in-project = true;
|
||||
};
|
||||
};
|
||||
|
||||
test.stubs.poetry = { };
|
||||
|
||||
nmt.script = let
|
||||
expectedConfDir =
|
||||
if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config";
|
||||
expectedConfigPath = "home-files/${expectedConfDir}/pypoetry/config.toml";
|
||||
expectedConfigContent = pkgs.writeText "poetry.config-custom.expected" ''
|
||||
[virtualenvs]
|
||||
create = true
|
||||
in-project = true
|
||||
'';
|
||||
in ''
|
||||
assertFileExists "${expectedConfigPath}"
|
||||
assertFileContent "${expectedConfigPath}" "${expectedConfigContent}"
|
||||
'';
|
||||
}
|
||||
15
tests/modules/programs/poetry/default-settings.nix
Normal file
15
tests/modules/programs/poetry/default-settings.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.poetry = { enable = true; };
|
||||
|
||||
test.stubs.poetry = { };
|
||||
|
||||
nmt.script = let
|
||||
expectedConfDir =
|
||||
if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config";
|
||||
expectedConfigPath = "home-files/${expectedConfDir}/pypoetry/config.toml";
|
||||
in ''
|
||||
assertPathNotExists "${expectedConfigPath}"
|
||||
'';
|
||||
}
|
||||
4
tests/modules/programs/poetry/default.nix
Normal file
4
tests/modules/programs/poetry/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
poetry-default-settings = ./default-settings.nix;
|
||||
poetry-custom-settings = ./custom-settings.nix;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue