Skip to content

Commit ec73d72

Browse files
chrahuntxavfernandez
authored andcommitted
Remove unused incompatible functions from tests.lib.Path.
1 parent ba2c382 commit ec73d72

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

news/pathlib-refactor-1.trivial

Whitespace-only changes.

tests/lib/path.py

+1-59
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ def __idiv__(self, path):
6767

6868
__itruediv__ = __idiv__
6969

70-
def __floordiv__(self, paths):
71-
"""
72-
Returns a list of paths prefixed with 'self'.
73-
74-
>>> '/home/a' // [bc.d, ef.g]
75-
[/home/a/bc.d, /home/a/ef.g]
76-
"""
77-
return [Path(self, path) for path in paths]
78-
7970
def __sub__(self, path):
8071
"""
8172
Makes this path relative to another path.
@@ -125,14 +116,7 @@ def namebase(self):
125116
"""
126117
'/home/a/bc.d' -> 'bc'
127118
"""
128-
return self.noext.name
129-
130-
@property
131-
def noext(self):
132-
"""
133-
'/home/a/bc.d' -> '/home/a/bc'
134-
"""
135-
return Path(os.path.splitext(self)[0])
119+
return Path(os.path.splitext(self)[0]).name
136120

137121
@property
138122
def ext(self):
@@ -162,13 +146,6 @@ def normpath(self):
162146
"""
163147
return Path(os.path.normpath(self))
164148

165-
@property
166-
def normcase(self):
167-
"""
168-
Deals with case-insensitive filesystems
169-
"""
170-
return Path(os.path.normcase(self))
171-
172149
@property
173150
def folder(self):
174151
"""
@@ -187,38 +164,6 @@ def exists(self):
187164
"""
188165
return os.path.exists(self)
189166

190-
@property
191-
def atime(self):
192-
"""
193-
Returns last accessed time.
194-
"""
195-
return os.path.getatime(self)
196-
197-
@property
198-
def mtime(self):
199-
"""
200-
Returns last modified time.
201-
"""
202-
return os.path.getmtime(self)
203-
204-
@property
205-
def ctime(self):
206-
"""
207-
Returns last changed time.
208-
"""
209-
return os.path.getctime(self)
210-
211-
@classmethod
212-
def supports_unicode(self):
213-
"""
214-
Returns True if the system can handle Unicode file names.
215-
"""
216-
return os.path.supports_unicode_filenames()
217-
218-
def walk(self, **kwargs):
219-
""" Returns a generator that walks through a directory tree. """
220-
return os.walk(self, **kwargs)
221-
222167
def mkdir(self, mode=0x1FF): # 0o777
223168
"""
224169
Creates a directory, if it doesn't exist already.
@@ -276,9 +221,6 @@ def rename(self, to):
276221
"""
277222
return os.rename(self, to)
278223

279-
def renames(self, to):
280-
return os.renames(self, to)
281-
282224
def glob(self, pattern):
283225
return (Path(i) for i in glob.iglob(self.join(pattern)))
284226

0 commit comments

Comments
 (0)