diff options
author | Robert Helgesson <robert@rycee.net> | 2021-07-23 22:32:14 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2021-07-23 22:57:13 +0200 |
commit | 953909341ea62291a4c4a9483214f9a12d58ec99 (patch) | |
tree | 1100cbf8edce555e88b006c8290978eeab54cdd6 /pkgs/tools/misc/trash-cli | |
parent | 04697264a425c1ea27b463fd660c95259b76f4a6 (diff) |
trash-cli: 0.21.6.30 -> 0.21.7.23
Also add an installation check.
Diffstat (limited to 'pkgs/tools/misc/trash-cli')
-rw-r--r-- | pkgs/tools/misc/trash-cli/default.nix | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/pkgs/tools/misc/trash-cli/default.nix b/pkgs/tools/misc/trash-cli/default.nix index dbc00e13e1ae8..301f6163d7699 100644 --- a/pkgs/tools/misc/trash-cli/default.nix +++ b/pkgs/tools/misc/trash-cli/default.nix @@ -2,13 +2,13 @@ python3Packages.buildPythonApplication rec { pname = "trash-cli"; - version = "0.21.6.30"; + version = "0.21.7.23"; src = fetchFromGitHub { owner = "andreafrancia"; repo = "trash-cli"; rev = version; - sha256 = "09vwg4jpx7pl7rd5ybq5ldgwky8zzf59msmzvmim9vipnmjgkxv7"; + sha256 = "1kdkzs9mbyac8ndc6r0wa39z8d3fj8zglqp149id4j37aydxb10l"; }; propagatedBuildInputs = [ python3Packages.psutil ]; @@ -18,8 +18,27 @@ python3Packages.buildPythonApplication rec { pytestCheckHook ]; - # Skip `test_user_specified` since its result depends on the mount path. - disabledTests = [ "test_user_specified" ]; + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + # Create a home directory with a test file. + HOME="$(mktemp -d)" + touch "$HOME/deleteme" + + # Verify that trash list is initially empty. + [[ $($out/bin/trash-list) == "" ]] + + # Trash a test file and verify that it shows up in the list. + $out/bin/trash "$HOME/deleteme" + [[ $($out/bin/trash-list) == *" $HOME/deleteme" ]] + + # Empty the trash and verify that it is empty. + $out/bin/trash-empty + [[ $($out/bin/trash-list) == "" ]] + + runHook postInstallCheck + ''; meta = with lib; { homepage = "https://github.com/andreafrancia/trash-cli"; |