aboutsummaryrefslogtreecommitdiff
path: root/src/mailman_pgp/testing/layers.py
diff options
context:
space:
mode:
authorJ08nY2017-08-07 22:48:47 +0200
committerJ08nY2017-08-07 22:48:47 +0200
commit473be2735dffc63b1ba759739ebfa7e471bc1495 (patch)
tree9007160fda9ad414b39aa7cd239a892f80da871a /src/mailman_pgp/testing/layers.py
parent60acd548ad4631b8c4a59a5f16ac8b497709a929 (diff)
downloadmailman-pgp-473be2735dffc63b1ba759739ebfa7e471bc1495.tar.gz
mailman-pgp-473be2735dffc63b1ba759739ebfa7e471bc1495.tar.zst
mailman-pgp-473be2735dffc63b1ba759739ebfa7e471bc1495.zip
Diffstat (limited to 'src/mailman_pgp/testing/layers.py')
-rw-r--r--src/mailman_pgp/testing/layers.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mailman_pgp/testing/layers.py b/src/mailman_pgp/testing/layers.py
index dcba526..986a388 100644
--- a/src/mailman_pgp/testing/layers.py
+++ b/src/mailman_pgp/testing/layers.py
@@ -15,8 +15,6 @@
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http://www.gnu.org/licenses/>.
import contextlib
-import os
-from os.path import isfile
from mailman.testing.layers import (ConfigLayer, RESTLayer, SMTPLayer)
from sqlalchemy.exc import SQLAlchemyError
@@ -31,11 +29,11 @@ def reset_rollback():
def reset_pgp_dirs():
- for keydir in (config.pgp.keydir_config.values()):
- for path in os.listdir(keydir):
- full_path = os.path.join(keydir, path)
- if isfile(full_path):
- os.remove(full_path)
+ for keydir in (config.pgp.keydirs.values()):
+ for path in keydir.iterdir():
+ full_path = keydir.joinpath(path)
+ if full_path.is_file():
+ full_path.unlink()
def reset_pgp_hard():