Skip to content

Commit

Permalink
Remove normpath from tests.lib.path.Path.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrahunt authored and xavfernandez committed Jul 20, 2019
1 parent 358e690 commit 3732e79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
10 changes: 7 additions & 3 deletions tests/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,16 @@ def assert_installed(self, pkg_name, editable=True, with_files=[],
sorted(self.files_created.keys())))

for f in with_files:
if not (pkg_dir / f).normpath in self.files_created:
normalized_path = os.path.normpath(pkg_dir / f)
if normalized_path not in self.files_created:
raise TestFailure(
'Package directory %r missing expected content %r' %
(pkg_dir, f)
)

for f in without_files:
if (pkg_dir / f).normpath in self.files_created:
normalized_path = os.path.normpath(pkg_dir / f)
if normalized_path in self.files_created:
raise TestFailure(
'Package directory %r has unexpected content %f' %
(pkg_dir, f)
Expand Down Expand Up @@ -424,7 +426,9 @@ def __init__(self, base_path, *args, **kwargs):
)
if sys.platform == 'win32':
if sys.version_info >= (3, 5):
scripts_base = self.user_site_path.joinpath('..').normpath
scripts_base = Path(
os.path.normpath(self.user_site_path.joinpath('..'))
)
else:
scripts_base = self.user_base_path
self.user_bin_path = scripts_base.joinpath('Scripts')
Expand Down
7 changes: 0 additions & 7 deletions tests/lib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,6 @@ def resolve(self):
"""
return Path(os.path.realpath(self))

@property
def normpath(self):
"""
'/home/x/.././a//bc.d' -> '/home/a/bc.d'
"""
return Path(os.path.normpath(self))

@property
def parent(self):
"""
Expand Down

0 comments on commit 3732e79

Please sign in to comment.