aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Sirabella <marco@sirabella.org>2021-04-24 00:11:33 -0700
committerZac Medico <zmedico@gentoo.org>2021-04-24 12:53:50 -0700
commit5926ccaf1ce40b6210bed29925483e644e9192b8 (patch)
tree84753d4812429c8a7dbba023be5af668659771ff
parentemerge: use parse_intermixed_args when available (bug 784566) (diff)
downloadportage-5926ccaf.tar.gz
portage-5926ccaf.tar.bz2
portage-5926ccaf.zip
tests: Remove unused assertExists helper
Signed-off-by: Marco Sirabella <marco@sirabella.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/portage/tests/__init__.py16
-rw-r--r--repoman/lib/repoman/tests/__init__.py18
2 files changed, 1 insertions, 33 deletions
diff --git a/lib/portage/tests/__init__.py b/lib/portage/tests/__init__.py
index de7e140c5..3faa15103 100644
--- a/lib/portage/tests/__init__.py
+++ b/lib/portage/tests/__init__.py
@@ -285,22 +285,6 @@ class TestCase(unittest.TestCase):
else: excName = str(excClass)
raise self.failureException("%s not raised: %s" % (excName, msg))
- def assertExists(self, path):
- """Make sure |path| exists"""
- if not os.path.exists(path):
- msg = ['path is missing: %s' % (path,)]
- while path != '/':
- path = os.path.dirname(path)
- if not path:
- # If we're given something like "foo", abort once we get to "".
- break
- result = os.path.exists(path)
- msg.append('\tos.path.exists(%s): %s' % (path, result))
- if result:
- msg.append('\tcontents: %r' % os.listdir(path))
- break
- raise self.failureException('\n'.join(msg))
-
def assertNotExists(self, path):
"""Make sure |path| does not exist"""
if os.path.exists(path):
diff --git a/repoman/lib/repoman/tests/__init__.py b/repoman/lib/repoman/tests/__init__.py
index 85c6f0b54..efc233aa4 100644
--- a/repoman/lib/repoman/tests/__init__.py
+++ b/repoman/lib/repoman/tests/__init__.py
@@ -1,5 +1,5 @@
# tests/__init__.py -- Portage Unit Test functionality
-# Copyright 2006-2020 Gentoo Authors
+# Copyright 2006-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
import argparse
@@ -262,22 +262,6 @@ class TestCase(unittest.TestCase):
else: excName = str(excClass)
raise self.failureException("%s not raised: %s" % (excName, msg))
- def assertExists(self, path):
- """Make sure |path| exists"""
- if not os.path.exists(path):
- msg = ['path is missing: %s' % (path,)]
- while path != '/':
- path = os.path.dirname(path)
- if not path:
- # If we're given something like "foo", abort once we get to "".
- break
- result = os.path.exists(path)
- msg.append('\tos.path.exists(%s): %s' % (path, result))
- if result:
- msg.append('\tcontents: %r' % os.listdir(path))
- break
- raise self.failureException('\n'.join(msg))
-
def assertNotExists(self, path):
"""Make sure |path| does not exist"""
if os.path.exists(path):