summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-misc/trash-cli/files/trash-cli-0.21.10.24-fix-lint-in-tests.patch')
-rw-r--r--app-misc/trash-cli/files/trash-cli-0.21.10.24-fix-lint-in-tests.patch99
1 files changed, 99 insertions, 0 deletions
diff --git a/app-misc/trash-cli/files/trash-cli-0.21.10.24-fix-lint-in-tests.patch b/app-misc/trash-cli/files/trash-cli-0.21.10.24-fix-lint-in-tests.patch
new file mode 100644
index 000000000000..8f7cfe3babf1
--- /dev/null
+++ b/app-misc/trash-cli/files/trash-cli-0.21.10.24-fix-lint-in-tests.patch
@@ -0,0 +1,99 @@
+From e467ae01869e853f83ebad4ef5514c5831283866 Mon Sep 17 00:00:00 2001
+From: Zoltan Puskas <zoltan@sinustrom.info>
+Date: Sat, 4 Dec 2021 13:16:48 -0800
+Subject: [PATCH 1/2] Fix lint in tests
+
+Running pyflakes on the code has shown several lint errors. This diff
+fixes them for the unit test files.
+
+Additionally myStringIO.py has been removed in favour of using six's
+StringIO for consistency with other tests.
+---
+ tests/empty/test_empty_end_to_end_interactive.py | 2 +-
+ tests/myStringIO.py | 4 ----
+ tests/put/test_file_trasher.py | 2 +-
+ tests/put/test_home_fallback.py | 2 +-
+ tests/test_restore_cmd.py | 2 +-
+ tests/test_trash_rm.py | 4 +---
+ 6 files changed, 5 insertions(+), 11 deletions(-)
+ delete mode 100644 tests/myStringIO.py
+
+diff --git a/tests/empty/test_empty_end_to_end_interactive.py b/tests/empty/test_empty_end_to_end_interactive.py
+index 80b8f81..64f20d6 100644
+--- a/tests/empty/test_empty_end_to_end_interactive.py
++++ b/tests/empty/test_empty_end_to_end_interactive.py
+@@ -4,7 +4,7 @@ import unittest
+ import pytest
+
+ from ..fake_trash_dir import FakeTrashDir
+-from ..support import MyPath, list_trash_dir
++from ..support import MyPath
+ from .. import run_command
+
+
+diff --git a/tests/myStringIO.py b/tests/myStringIO.py
+deleted file mode 100644
+index 40a6c72..0000000
+--- a/tests/myStringIO.py
++++ /dev/null
+@@ -1,4 +0,0 @@
+-try:
+- from StringIO import StringIO
+-except ImportError:
+- from io import StringIO
+diff --git a/tests/put/test_file_trasher.py b/tests/put/test_file_trasher.py
+index 32e8019..37fb9db 100644
+--- a/tests/put/test_file_trasher.py
++++ b/tests/put/test_file_trasher.py
+@@ -3,7 +3,7 @@ import unittest
+ from mock import Mock
+ from datetime import datetime
+
+-from trashcli.put import TrashResult, Trasher, FileTrasher
++from trashcli.put import TrashResult, FileTrasher
+ import os
+
+
+diff --git a/tests/put/test_home_fallback.py b/tests/put/test_home_fallback.py
+index 07d40a2..38b7fb4 100644
+--- a/tests/put/test_home_fallback.py
++++ b/tests/put/test_home_fallback.py
+@@ -3,7 +3,7 @@ import unittest
+ from mock import Mock, call, ANY
+
+ from trashcli.fstab import create_fake_volume_of
+-from trashcli.put import TrashResult, Trasher, TrashDirectoriesFinder, FileTrasher
++from trashcli.put import TrashResult, TrashDirectoriesFinder, FileTrasher
+ from datetime import datetime
+ import os
+
+diff --git a/tests/test_restore_cmd.py b/tests/test_restore_cmd.py
+index b1cda13..63c017d 100644
+--- a/tests/test_restore_cmd.py
++++ b/tests/test_restore_cmd.py
+@@ -3,7 +3,7 @@ import unittest
+ from trashcli.list_mount_points import os_mount_points
+ from trashcli.restore import RestoreCmd, make_trash_directories, \
+ TrashDirectory, TrashedFiles, Command
+-from .myStringIO import StringIO
++from six import StringIO
+ from mock import call
+ from trashcli import restore
+ import datetime
+diff --git a/tests/test_trash_rm.py b/tests/test_trash_rm.py
+index e11935e..ec7e7e6 100644
+--- a/tests/test_trash_rm.py
++++ b/tests/test_trash_rm.py
+@@ -1,8 +1,6 @@
+ import unittest
+
+-import six
+-
+-from mock import Mock, call
++from mock import Mock
+
+ from trashcli.rm import Filter
+ from six import StringIO
+--
+2.33.1
+