summaryrefslogtreecommitdiff
blob: 8f7cfe3babf1ebe2f40cead4892cf381b2a2197e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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