diff options
author | Chris Hunt <chrahunt@gmail.com> | 2019-06-30 21:55:00 -0400 |
---|---|---|
committer | Xavier Fernandez <xav.fernandez@gmail.com> | 2019-07-01 10:23:03 +0200 |
commit | ec73d72fd33e92f6ec52c99964cb26d726a26af4 (patch) | |
tree | d29b6afb9415edb4bf574575e92db676adfac1bf | |
parent | ba2c382511c61a53720fe8c08ee2f150286c846d (diff) | |
download | pip-ec73d72fd33e92f6ec52c99964cb26d726a26af4.tar.gz |
Remove unused incompatible functions from tests.lib.Path.
-rw-r--r-- | news/pathlib-refactor-1.trivial | 0 | ||||
-rw-r--r-- | tests/lib/path.py | 60 |
2 files changed, 1 insertions, 59 deletions
diff --git a/news/pathlib-refactor-1.trivial b/news/pathlib-refactor-1.trivial new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/news/pathlib-refactor-1.trivial diff --git a/tests/lib/path.py b/tests/lib/path.py index ecbb0d6ca..b1fc38463 100644 --- a/tests/lib/path.py +++ b/tests/lib/path.py @@ -67,15 +67,6 @@ class Path(_base): __itruediv__ = __idiv__ - def __floordiv__(self, paths): - """ - Returns a list of paths prefixed with 'self'. - - >>> '/home/a' // [bc.d, ef.g] - [/home/a/bc.d, /home/a/ef.g] - """ - return [Path(self, path) for path in paths] - def __sub__(self, path): """ Makes this path relative to another path. @@ -125,14 +116,7 @@ class Path(_base): """ '/home/a/bc.d' -> 'bc' """ - return self.noext.name - - @property - def noext(self): - """ - '/home/a/bc.d' -> '/home/a/bc' - """ - return Path(os.path.splitext(self)[0]) + return Path(os.path.splitext(self)[0]).name @property def ext(self): @@ -163,13 +147,6 @@ class Path(_base): return Path(os.path.normpath(self)) @property - def normcase(self): - """ - Deals with case-insensitive filesystems - """ - return Path(os.path.normcase(self)) - - @property def folder(self): """ Returns the folder of this path. @@ -187,38 +164,6 @@ class Path(_base): """ return os.path.exists(self) - @property - def atime(self): - """ - Returns last accessed time. - """ - return os.path.getatime(self) - - @property - def mtime(self): - """ - Returns last modified time. - """ - return os.path.getmtime(self) - - @property - def ctime(self): - """ - Returns last changed time. - """ - return os.path.getctime(self) - - @classmethod - def supports_unicode(self): - """ - Returns True if the system can handle Unicode file names. - """ - return os.path.supports_unicode_filenames() - - def walk(self, **kwargs): - """ Returns a generator that walks through a directory tree. """ - return os.walk(self, **kwargs) - def mkdir(self, mode=0x1FF): # 0o777 """ Creates a directory, if it doesn't exist already. @@ -276,9 +221,6 @@ class Path(_base): """ return os.rename(self, to) - def renames(self, to): - return os.renames(self, to) - def glob(self, pattern): return (Path(i) for i in glob.iglob(self.join(pattern))) |